文件不明确。如何在本地安装证书等?
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.
最佳答案
我已经通过设置一个 Apache 反向代理来终止 Meteor 前面的 SSL,并想在这里记录下来。
我在 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>
关于ssl - 如何在不部署到 meteor.com 子域的情况下在 meteor.js 中使用 force-ssl?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13557541/