I have setup a django app and connected it to AWS via elasticbeanstalk. I followed a configuration tutorial, and I assume I am doing everything correctly.
However, when trying to connect to the elasticbeanstalk app on AWS, I receive the error below:
502 Bad Gateway (nginx/1.20.0)
I'm unsure why I am getting this error and am wondering if it potentially has something to do with the structure of my application.
My django app is within a bigger folder (the main repository), and is also being stored alongside the front end of the app directory which are both in the same directory. Might this be the problem? Does Elastic Beanstalk not know which subfolder is the app? I declared eb init on the main folder and not the folder containing the Django app.
These are the elasticbeanstalk environment logs:
2022/04/20 22:35:50 [error] 26916#26916: *1993 connect() failed (111: Connection refused) while connecting to upstream, client: ip address, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "ip address"