Skip to content Skip to sidebar Skip to footer

How Can I Fix 502 Error In A Flask Application That I Uploaded In Aws?

I'm having problems with uploading my flask app in an AWS server with elastic beanstalk. after I upload my code a 502 bad gateway error appears in the environment.

Solution 1:

Here are my 2 cents after grappling with this for a few hours and using Flask/Eb for over a year.

Even the AWS tutorial did not work for me-- I kept getting this 502 error.

The reason why I ran into this error, whereas I had not before, was that I selected Python 3.7 when creating the environment. This selection causes Eb to use nginx as the default proxy server. (To see this, go to your environment, select Configuration, and then Software)

The simple fix for me was to create a new environment and use Python 3.6, which worked like a charm.

Hopefully, someone finds a real solution because it would be nice to use Python 3.7, but this might even be an AWS bug considering I changed nothing about my code to get it to work (just the setup change from Python 3.7 to 3.6).

Post a Comment for "How Can I Fix 502 Error In A Flask Application That I Uploaded In Aws?"