【问题标题】:Having issues setting running Meteor app with SSL on AWS Opsworks在 AWS Opsworks 上使用 SSL 设置运行 Meteor 应用程序时遇到问题
【发布时间】:2015-05-11 05:16:38
【问题描述】:

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

另外,我正在使用开箱即用的 Opsworks HAPROXY 负载均衡器。

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

在浏览器中,我看到了:

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

欢迎任何想法

【问题讨论】:

  • 嘿@aginsburg 你能发布你的HAPROXY配置文件吗
  • 谢谢@nathan 谢谢 - 抱歉这个愚蠢的问题,你知道我在 opsworks 上哪里可以找到这个...我知道 Beanstalk 有点像迷宫。
  • 对opswork不太熟悉;另一方面,这听起来像是您要求流星终止 SSL;而不是在 HAProxy 处终止 SSL,然后将常规 HTTP 发送到流星(需要)。
  • 你可能是对的...我将通过 AWS 支持提出这个问题,因为他们没有 Meteor 经验,正在苦苦挣扎。

标签: node.js ssl meteor aws-opsworks


【解决方案1】:

您的 HAproxy 配置期望流星/节点以 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

【讨论】:

  • 非常感谢。现在要尝试一下...需要使用自定义食谱来获得结果,并且作为初学者(甚至不是厨师)...可能需要一些摆弄;-)
  • 啊,我应该加上 - 这是我最近用过的食谱...见第 267 行以后:github.com/Buzzy-Buzz/buzzy-opswork-cookbook/blob/master/…
  • 哎呀......啊我应该添加 - 这是我最近使用的食谱......见第 267 行以后:github.com/Buzzy-Buzz/buzzy-opswork-cookbook/blob/master/… 所以我只是修改 269 以包含“bind :443 ssl crt /path/to/your/certificate”然后在它下面添加“reqadd X-Forwarded-Proto:\ https”?然后做你的台词:“acl nodejs_application_buzzy_domain_buzzy hdr_end(host) -i buzzy use_backend nodejs_app_servers if nodejs_application_buzzy_domain_buzzy”参考第 189 和 223 行?
  • 我确实尝试过在这里拍摄...github.com/Buzzy-Buzz/buzzy-opswork-cookbook/blob/https-test/… 但不确定这是否正确?
猜你喜欢
  • 1970-01-01
  • 2014-04-16
  • 1970-01-01
  • 2017-04-07
  • 2018-03-18
  • 1970-01-01
  • 2019-10-23
  • 2023-04-07
  • 1970-01-01
相关资源
最近更新 更多