【发布时间】:2015-01-20 22:37:20
【问题描述】:
我在 AWS Elastic Beanstalk 上运行 Meteor。一切都启动并运行,除了它没有运行 Websockets 并出现以下错误:
WebSocket connection to 'ws://MYDOMAIN/sockjs/834/sxx0k7vn/websocket' failed: Error during WebSocket handshake: Unexpected response code: 400
我的理解是添加如下内容:
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
通过我的 YML 配置文件到代理配置。
通过我的 .exbextension 配置文件:
files:
"/etc/nginx/conf.d/proxy.conf" :
mode: "000755"
owner: root
group: root
content: |
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
我已经 ssh 进入服务器,我可以看到 proxy.conf 里面有这两行。
当我点击我的网络服务器时,我仍然看到“WebSocket 握手期间出错:”错误。
我的 beanstalk 负载配置了棒会话和以下端口:
顺便说一句,我确实看到了 https://meteorhacks.com/load-balancing-your-meteor-app.html 并且我尝试过:
Enable HTTP load balancing with Sticky Session on Port 80
Enable TCP load balancing on Port 8080, which allows websocket
但似乎也无法让它发挥作用。
添加另一个在此处不起作用的 YAML 的镜头“:https://gist.github.com/adamgins/0c0258d6e1b8203fd051
任何帮助表示赞赏?
【问题讨论】:
标签: node.js amazon-web-services nginx meteor amazon-elastic-beanstalk