Error on EB AWS - 502 Bad Gateway nginx/1.18.0

Viewed 3794

I have a problem regarding my Node app that I am running in AWS. Everything has been working fine until today.

Without any new deployment to the app, I am getting this 502 error when I try to access the URL.

I have checked the nginx logs, and Im getting this:

2020/10/11 01:24:55 [error] 4735#0: *1 connect() failed (111: Connection refused) while connecting to upstream, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8080/favicon.ico", host: "mydomain.com", referrer: "mydomain.com"

I have tried to create a new security group with new inbound rules but it didnt work, has there been ane "new" update on EB configuration Im missing?

Thanks in advance.

2 Answers

enter image description hereIf you are using python > 3.6 on eb. Then eb will use gunicorn to run your django app. So you need to install gunicorn with pip install gunicorn also mention it in requirements.txt with pip freeze requirements.txt and most important thing is You need to create "Procfile" in your project root where manage.py is located. "Procfile" will have no extension. "Procfile" content is below: web: gunicorn --bind :8000 --workers 3 --threads 2 ebdjango.wsgi:application in place of ebdjango put you project name and deploy with eb deploy. Thanks!

I got exactly the same problem exactly at the same time than you. My solution was to remove the start of the program from index.js to the app.js. After that everything works fine again. For the some reason aws does not start index.js file anymore.

Related