Flask + uwsgi + nginx + debug. Error 502 instead of the debugger page

Run the checkbox on the server using uWsgi.

UWsgi configuration

<uwsgi> <socket>/tmp/flask.sock</socket> <pythonpath>/home/reweb/flask/</pythonpath> <module>publicist:app</module> <plugins>python27</plugins> <uid>reweb</uid> <touch-reload>/home/reweb/reload</touch-reload> </uwsgi> 

nginx config

 upstream flask_serv { server unix:/tmp/flask.sock; } server { listen 80; server_name some-domain.com; access_log /home/reweb/log/nginx-access.log; error_log /home/reweb/log/nginx-error.log; location / { uwsgi_pass flask_serv; include uwsgi_params; } } 

But instead of debugging the nginx page, I will show me error 502.
The whole Flask error tracking error I can see in the uwsgi error log.

UPDATE
Find old question nginx + uwsgi + flask - disable custom error pages no answer

+4
source share
2 answers

All you need to know:

fooobar.com/questions/180489 / ...
fooobar.com/questions/180489 / ...

Two answers from a duplicate question

+2
source

Flask debug = True does not work when viewing uWSGI

may I help. In fact, uwsgi is not intended for a development environment where you want to debug information in a browser. This is a production server.

maybe adding to app.debug = true may help after you instantiate the Flask object, but otherwise, use the internal flash server for development to get the correct debugger.

+1
source

Source: https://habr.com/ru/post/1488897/


All Articles