gpt4 book ai didi

node.js - 在 AWS Opsworks 上设置使用 SSL 运行 Meteor 应用程序时遇到问题

转载 作者:太空宇宙 更新时间:2023-11-03 14:56:19 25 4
gpt4 key购买 nike

我的基本情况是我的 Meteor 应用程序在 Opsworks 上完美运行。我做了一个 Meteor build,调整了文件,一切都很好(没有 HTTPS/SSL)。我没有使用 METEORUP。我只是上传调整后的构建文件并部署到 opsworks 上。

此外,我使用的是开箱即​​用的 Opsworks HAPROXY 负载均衡器。

然后我为我的应用安装 SSL 证书,并根据屏幕截图将 Meteor 设置为在 PORT=443 上列出:

enter image description here

在浏览器中,我看到:

503 Service Unavailable

No server is available to handle this request.

在我看到的日志文件中:

Mar  8 03:22:51 nodejs-app1 monit[2216]: 'node_web_app_buzzy' start: /bin/bash
Mar 8 03:23:51 nodejs-app1 monit[2216]: 'node_web_app_buzzy' failed, cannot ope
n a connection to INET[127.0.0.1:443/] via TCPSSL

欢迎任何想法

最佳答案

您的 HAproxy 配置需要 meteor/node 以 SSL 响应。

相反,它应该终止 SSL 并以纯 HTTP 与 Node/ meteor 通信。这是因为,meteor 不支持 SSL;它需要前面的服务器来处理它。

解决方法: Update the frontend https-in section to terminate ssl and redirect to the http backend

defaults
#... add this line to enable the `X-Forwarded-For` header
option forwardfor
# ...

# .... update this section ...
frontend https-in
mode tcp
# this bit causes HAProxy to talk TLS rather than just forward the connection
bind :443 ssl crt /path/to/your/certificate
reqadd X-Forwarded-Proto:\ https
# now direct it to your plain HTTP application
acl nodejs_application_buzzy_domain_buzzy hdr_end(host) -i buzzy
use_backend nodejs_app_servers if nodejs_application_buzzy_domain_buzzy

关于node.js - 在 AWS Opsworks 上设置使用 SSL 运行 Meteor 应用程序时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28952351/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com