错误描述
2021/11/30 17:52:40 [error] 18156#0: *49 upstream prematurely closed connection while reading response header from upstream, client: 124.65.173.246, server: _, request: "POST /testSystem/question-config/find_data/?v=1638264442773 HTTP/2.0", upstream: "http://127.0.0.1:8101/question-config/find_data/?v=1638264442773", host: "182.92.205.102:18080", referrer: "https://182.92.205.102:18080/"
错误解决
这个错误是因为nginx上的配置协议和uwsgi启动的协议没对上,正确的配置:
nginx: pass_pass ===> uwsgi: http
nginx: uwsgi_pass ===> uwsgi: socket
下面是我的配置
[uwsgi]
http=127.0.0.1:8101
chdir=/testSystem/TestingSystem
module=TestingSystem.wsgi:application
master=True
vacuum=True
max-requests=5000
buffer-size = 65536
daemonize=/testSystem/TestingSystem/log/ts.log
env = LANG=en_US.UTF-8
pidfile=/testSystem/TestingSystem/run/ts.pid
# nginx的配置
location /testSystem/ {
proxy_pass http://backend/;
}