【问题标题】:AWS Deployment NGINX Connection Refused for Node.JS ProjectAWS 部署 NGINX 连接被拒绝用于 Node.JS 项目
【发布时间】:2015-06-25 07:36:02
【问题描述】:

有一个标准的Node.JS 项目。在AWS 上部署时,服务器正在正常运行和初始化,但NGINX 给出以下错误

-------------------------------------
/var/log/nginx/error.log
-------------------------------------
2015/04/18 10:49:56 [error] 4445#0: *6 connect() failed (111: Connection refused) while connecting to upstream, client: XXX.XX.XX.XX, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8081/", host: "stagingmyproj.elasticbeanstalk.com"
2015/04/18 10:49:56 [error] 4445#0: *6 connect() failed (111: Connection refused) while connecting to upstream, client: XXX.XX.XX.XX, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8081/favicon.ico", host: "stagingmyproj.elasticbeanstalk.com"
2015/04/18 10:50:05 [error] 4445#0: *6 connect() failed (111: Connection refused) while connecting to upstream, client: XXX.XX.XX.XX, server: , request: "GET /vendor/login HTTP/1.1", upstream: "http://127.0.0.1:8081/vendor/login", host: "stagingmyproj.elasticbeanstalk.com"
2015/04/18 10:50:06 [error] 4445#0: *6 connect() failed (111: Connection refused) while connecting to upstream, client: XXX.XX.XX.XX, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8081/favicon.ico", host: "stagingmyproj.elasticbeanstalk.com"
2015/04/18 10:50:28 [error] 4445#0: *6 connect() failed (111: Connection refused) while connecting to upstream, client: XXX.XX.XX.XX, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8081/", host: "stagingmyproj.elasticbeanstalk.com"
2015/04/18 10:50:28 [error] 4445#0: *6 connect() failed (111: Connection refused) while connecting to upstream, client: XXX.XX.XX.XX, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8081/favicon.ico", host: "stagingmyproj.elasticbeanstalk.com"

我正在使用 AWS Elastic BEanstalk 控制台。不是命令行工具。不确定我是否还在使用 NGInx。

我不是 Dev Ops 人员,但我对 NGinx 没有任何线索。最好的解决方案是什么?

提前干杯和感谢。

【问题讨论】:

  • 尝试检查您使用的 nginx 版本。您将需要 1.3.13 或更高版本。我会推荐 1.6
  • 能否提供更多配置细节,如端口等?

标签: node.js mongodb amazon-web-services nginx amazon-elastic-beanstalk


【解决方案1】:

看看我之前回答的这个答案。很多人对某一部分有问题,所以答案试图解释从浏览器到 nginx 的所有内容:elastic beanstalk weird nginx configuration

它至少应该为您提供调试和消除问题的起点。

【讨论】:

  • 谢谢@josh-davis。效果很好。我可能对 YAML 语法有问题! :(
猜你喜欢
  • 2021-06-27
  • 1970-01-01
  • 2019-03-03
  • 1970-01-01
  • 2013-03-02
  • 2020-09-16
  • 2021-01-16
  • 1970-01-01
  • 2015-04-26
相关资源
最近更新 更多