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

poo*_*per 6 ssl meteor

该文件不清楚.如何在localhost中安装证书等?

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.
Run Code Online (Sandbox Code Playgroud)

Ola*_*erg 2

您不需要在本地主机上安装证书。正如它所说的“为了简化开发,始终通过 HTTP 接受来自本地主机的未加密连接。”,这意味着您可以在不使用 SSL 和安装证书的情况下开发和测试应用程序。只需运行您的应用程序并http://localhost:3000像平常一样访问它即可。

如果您正在讨论为面向公众的应用程序安装证书,那么最好使用反向代理服务器(例如)nginx并为该服务器安装证书。http://wiki.nginx.org/HttpProxyModule

  • 如果我正在与 Stripe 等 API 交互并且需要本地 SSL,该怎么办? (9认同)