Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

393
Views
502 Bad Gateway Error in AWS ElasticBeanstalk while deploying Flask Application

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.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

rename app.py to application.py, in app code to application. It worked for me.

from flask import Flask, render_template

application = Flask(__name__)

@application.route("/")
def index():
    return render_template('index.html')    

if __name__ == "__main__":
    application.run(debug=True)
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!