【发布时间】:2020-03-04 16:31:09
【问题描述】:
当使用带有 uwsgi-file 参数的 uwsgi 时,我可以在 127.0.0.1/hello.py 看到正确呈现的页面:
plugin = python3
master = true
processes = 5
chdir = /var/www/web1/
http = 127.0.0.1:9090
wsgi-file = /var/www/web1/hello.py
stats = 127.0.0.1:9191
chmod-socket = 777
vacuum = true
enable-threads = true
die-on-term = true
但是当我使用 nginx 从 nginx 反向代理时
location ~ \.py$ {
try_files $uri /index.py =404;
proxy_pass http://127.0.0.1:9090;
include uwsgi_params;
}
并禁用 uwsgi-file 参数:
plugin = python3
master = true
processes = 5
chdir = /var/www/web1/
http = 127.0.0.1:9090
#wsgi-file = /var/www/web1/hello.py
stats = 127.0.0.1:9191
chmod-socket = 777
vacuum = true
enable-threads = true
die-on-term = true
然后我得到这些错误:
浏览器 - “内部服务器错误”
nginx 控制台 - “GET /hello.py HTTP/1.1” 500 32
uwsgi 控制台 - “GET /hello.py => 在 0 毫秒内生成 21 个字节 (HTTP/1.0 500) 在 83 个字节中生成 2 个标头(0 核心 0 上的开关)”
请帮我解决这个问题
【问题讨论】: