ssl - 如何在不部署到 meteor.com 子域的情况下在 meteor.js 中使用 force-ssl?

标签 ssl meteor

文件不明确。如何在本地安装证书等?

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/

相关文章:

api - github API 不支持的媒体类型 415

mongodb - 如何连接到 Meteor 中的外部 MongoDB 实例?

node.js - 让我们加密 SSL 无法从 "Error: EACCES: permission denied, open '/etc/letsencrypt/live/domain.net/privkey.pem 开始'”

android - 在 Android 上使用 Volley 的 SSL 证书的过程是什么

Java 邮件 (TLS) : Erratic failure to validate certification path

javascript - Spotify json 响应包含换行符?

apache - 在本地主机上使用 SSL 的 Yii2 高级应用程序

java - 错误 : Not trusted server certificate on Android 2. 3 及更早版本

meteor 公用文件夹不起作用

javascript - 如何撤消 "Meteor.publish"和撤消 "new Meteor.Collection"