当使用带有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反向代理时>
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毫秒(HTTP / 1.0 500)中产生了21个字节,在83个字节中产生了2个报头(核心0上的0个开关)”
我可以帮忙解决此问题吗
当将uwsgi与uwsgi-file参数一起使用时,我可以在127.0.0.1/hello.py看到正确呈现的页面:plugin = python3 master = true进程= 5 chdir = / var / www / web1 / http = 127.0。 0.1:9090 ...
解决方案要求uWSGI运行CGI脚本: