UWSGI + NGINX 502 Bad Gateway

版权声明:From 开玄 https://blog.csdn.net/nerdcfl/article/details/80155290

UWSGI + NGINX 502 Bad Gateway

最近进行uwsgi+nginx+django在阿里云上的部署小实验,发现502 Bad Gateway,于是记录下解决方案:

uwsgi的ini文件内容如下:

[uwsgi]
socket=:8000
plugin=python3
wsgi-file=test.py
master=true
processes=1
threads=1
stats=127.0.0.1:9191

排除了django没有安装之类的问题之后,注意其中的socket=:8000,此时用nginx的端口访问则可以成功完成,若改为http-socket=:8000则只能通过uwsgi的端口进行访问。

猜你喜欢

转载自blog.csdn.net/nerdcfl/article/details/80155290