AWS 部署 NGINX 连接被拒绝用于 Node.JS 项目
Posted
技术标签:
【中文标题】AWS 部署 NGINX 连接被拒绝用于 Node.JS 项目【英文标题】:AWS Deployment NGINX Connection Refused for Node.JS Project 【发布时间】: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 能否提供更多配置细节,如端口等? 【参考方案1】:看看我之前回答的这个答案。很多人对某一部分有问题,所以答案试图解释从浏览器到 nginx 的所有内容:elastic beanstalk weird nginx configuration
它至少应该为您提供调试和消除问题的起点。
【讨论】:
谢谢@josh-davis。效果很好。我可能对 YAML 语法有问题! :(以上是关于AWS 部署 NGINX 连接被拒绝用于 Node.JS 项目的主要内容,如果未能解决你的问题,请参考以下文章
docker和nginx部署:java.net.ConnectException:连接被拒绝(连接被拒绝)
ASK-CLI 部署不适用于托管“使用 CloudFormation 的 AWS” - Alexa 区域“默认”:访问被拒绝
aws 部署错误 ebcli.objects.exceptions.NotAuthorizedError:操作被拒绝。拒绝访问
AWS:EACCES:权限被拒绝,mkdir '/home/react-app/node_modules/node-sass/vendor'