I have created a Flask Application and deployed it in AWS ElasticBeanstalk. On accessing the EBS URL, I am getting the 502 Bad Gateway Error. nginx/1.16.1
On checking the error logs i see the following error:
[error] 3789#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 119.82.***.***, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "ec2-**-**-***-33.ap-south-1.compute.amazonaws.com"
I checked all the available solutions, but none of them work. Please help.