2012-11-26 9 views
6

文書がはっきりしていません。 localhostに証明書などをインストールするには?meteor.comサブドメインに配備せずにmeteor.jsでforce-sslを使用する方法は?

force-ssl 

This package causes Meteor to redirect insecure connections (HTTP) to a secure URL (HTTPS). Use this package to ensure that communication to the server is always encrypted to protect users from active spoofing attacks. 

To simplify development, unencrypted connections from localhost are always accepted over HTTP. 

Application bundles (meteor bundle) do not include an HTTPS server or certificate. A proxy server that terminates SSL in front of a Meteor bundle must set the standard x-forwarded-proto header for the force-ssl package to work. 

Applications deployed to meteor.com subdomains with meteor deploy are automatically served via HTTPS using Meteor's certificate. 

答えて

2

ローカルホストに証明書をインストールする必要はありません。 「開発を簡素化するために、ローカルホストからの暗号化されていない接続は常にHTTP経由で受け入れられる」ということです。つまり、SSLを使用せずに、証明書をインストールせずにアプリケーションを開発してテストすることができます。あなただけのアプリケーションを実行し、いつものようにhttp://localhost:3000でアクセスしてください。

公開アプリケーション向けの証明書をインストールする場合は、nginxなどのリバースプロキシサーバーを使用し、そのサーバーの証明書をインストールするのが最善の方法です。​​

+8

? –

4

私は、Meteorの前でSSLを終了するApacheリバースプロキシを設定することに躊躇し、ここでそれを文書化したかったのです。

私は、SSL仮想ホストの設定ファイルに以下を追加しました:私はストライプのようなAPIをどのように相互作用していた場合、ローカルにSSLが必要

<VirtualHost _default_:443> 
     ServerName server.domain.com 

     ## SSL Engine Switch: 
     # Enable/Disable SSL for this virtual host. 
     SSLEngine on 

     ## Proxy to port 3000 for Meteor apps 
     SSLProxyEngine On 
     ProxyRequests Off # Disable forward proxying 
     ProxyPass/http://localhost:3000 
     ProxyPassReverse/http://localhost:3000 

     ## Your other SSL config directives such as certificates, etc. 

</VirtualHost> 
+0

優れた答え。 'ProxyPass/http:// localhost:3000 /'と 'ProxyPassReverse/http:// localhost:3000 /' – alste

+0

逆プロキシをサポートするApache 2.4.6以降が必要だと思いますWebSocket接続も同様です。 –

関連する問題