简体   繁体   English

AWS Elastic Beanstalk(Dash plotly 应用程序)- 502 错误网关

[英]AWS Elastic Beanstalk (Dash plotly app) - 502 Bad Gateway

I am a newbie with programming and my boss would like me to deploy a dash plotly app on AWS elastic beanstalk.我是编程新手,我的老板希望我在 AWS 弹性 beantalk 上部署一个 dash plotly 应用程序。 The code was deployed successfully but it is showing 502 bad gateway error.代码已成功部署,但显示502 bad gateway 错误。

502 Bad Gateway 502错误的网关
nginx/1.18.0 nginx/1.18.0

I tried to look into the /var/log/nginx/error.log and changed the port to 8000 but it still didn't work.我试图查看 /var/log/nginx/error.log 并将端口更改为8000但它仍然无法正常工作。

What is the solution for this error?这个错误的解决方法是什么? Should I add Procfile and what should I add into that file?我应该添加 Procfile 以及应该在该文件中添加什么? Thanks so much in advance!非常感谢!

/var/log/nginx/error.log /var/log/nginx/error.log

2020/11/25 05:24:52 [error] 16068#0: *38 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.38.82, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "172.31.7.83"
2020/11/25 05:25:01 [error] 16068#0: *40 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.2.244, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "172.31.7.83"
2020/11/25 05:25:07 [error] 16068#0: *42 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.38.82, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "172.31.7.83"
2020/11/25 05:25:16 [error] 16545#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.2.244, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "172.31.7.83"
2020/11/25 05:25:22 [error] 16545#0: *3 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.38.82, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "dashmonitoring1-env.eba-umwfi3nn.us-east-2.elasticbeanstalk.com"
2020/11/25 05:25:22 [error] 16545#0: *5 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.38.82, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "172.31.7.83"
2020/11/25 05:25:22 [error] 16545#0: *3 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.38.82, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8000/favicon.ico", host: "dashmonitoring1-env.eba-umwfi3nn.us-east-2.elasticbeanstalk.com", referrer: "http://dashmonitoring1-env.eba-umwfi3nn.us-east-2.elasticbeanstalk.com/"
2020/11/25 05:25:31 [error] 16545#0: *8 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.2.244, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "172.31.7.83"
2020/11/25 05:25:37 [error] 16545#0: *10 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.38.82, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "172.31.7.83"
2020/11/25 05:25:46 [error] 16545#0: *12 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.2.244, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "172.31.7.83"
2020/11/25 05:25:52 [error] 16545#0: *14 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.38.82, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "172.31.7.83"
2020/11/25 05:26:01 [error] 16545#0: *16 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.2.244, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "172.31.7.83"
2020/11/25 05:26:07 [error] 16545#0: *18 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.38.82, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "172.31.7.83"

For me, this solved the issue https://stackoverflow.com/a/67300325/15524555 .对我来说,这解决了这个问题https://stackoverflow.com/a/67300325/15524555 Basically my .ebextensions/application.config file wasn't pointing correctly to the dash app instance.基本上我的.ebextensions/application.config文件没有正确指向 dash 应用程序实例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM