django+uwsgi: upstream prematurely closed connection while reading response header from upstream 报错
错误描述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-
·
错误描述
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/;
}

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)