How can i fix 502 error in a flask application that i uploaded in AWS?

前端 未结 1 1199
悲&欢浪女
悲&欢浪女 2021-01-24 04:53

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.

相关标签:
1条回答
  • 2021-01-24 05:30

    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).

    0 讨论(0)
提交回复
热议问题