使用uWsgi在服务器上运行Flask。Flask + uwsgi + nginx + debug。 502错误代替调试器页面
uWsgi配置
<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的配置
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;
}
}
但不是调试器页面的nginx给我502错误。
所有Flask错误追溯我可以在uwsgi错误日志中看到。
UPDATE
查找老问题nginx + uwsgi + flask - disabling custom error pages没有答案
您是否尝试过这个没有答案的上游? –
@JoeDoherty,是的,都一样。 – Jafte
[Flask debug = True在通过uWSGI时无法正常工作](http://stackoverflow.com/questions/10364854/flask-debug-true-does-not-work-when-going-through-uwsgi) –