Node.JS 项目的 AWS 部署 NGINX 连接被拒绝

AWS Deployment NGINX Connection Refused for Node.JS Project

有一个标准 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 的所有内容:elastic beanstalk weird nginx configuration

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