Desmond888
Desmond888

Reputation: 1

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. The code was deployed successfully but it is showing 502 bad gateway error.

502 Bad Gateway
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.

What is the solution for this error? Should I add Procfile and what should I add into that file? Thanks so much in advance!

/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"

Upvotes: 0

Views: 1243

Answers (1)

groldan
groldan

Reputation: 11

For me, this solved the issue https://stackoverflow.com/a/67300325/15524555 . Basically my .ebextensions/application.config file wasn't pointing correctly to the dash app instance.

Upvotes: 1

Related Questions