django upstream prematurely closed connection while reading response header from up
2018-01-23 12:54
681 查看
1. 环境
django + uwsgi + Nginx2. 解决方式
1.必须要在uwsgi.ini中设置“limit-as”,该值是每个uwsgi进程占用的虚拟内存的最大限制。2.检查是否设置了
proxy_http_version 1.1; proxy_set_header Connection "";
Nginx默认使用HTTP1.0从后端获取响应返还给客户端,但是HTTP1.0不支持keepalive,因此需要配置proxy_http_version 1.1,proxy_set_header Connection默认close:通知后端服务器主动关闭连接,这样会导致任何一个客户端的请求都在后端服务器上产生了一个TIME-WAIT状态的连接。
3.检查uwsgi和Nginx中设置的各种timeout是否过短。
3. 参考资料
https://www.cnblogs.com/succour/p/6305574.htmlhttps://www.cnblogs.com/jackluo/p/3410739.html
https://monicalent.com/blog/2013/12/06/set-up-nginx-and-uwsgi/
相关文章推荐
- Nginx" upstream prematurely closed connection while reading response header from upstream"问题排查
- upstream prematurely closed connection while reading response header from upstream分析与解决
- recv() failed (104: Connection reset by peer) while reading response header from upstream
- recv() failed (104: Connection reset by peer) while reading response header from upstream
- recv() failed (104: Connection reset by peer) while reading response header from upstream
- php502问题解决:recv() failed (104: Connection reset by peer) while reading response header from upstream
- upstream timed out (110: Connection timed out) while reading response header from upstream 问题解决
- failed (104: Connection reset by peer) while reading response header from upstream, client: x.x.x.x
- nginx upstream timed out (110: Connection timed out) while reading response header from upstream
- nginx recv() failed (104: Connection reset by peer) while reading response header from upstream解决方法
- 解决 recv() failed (104: Connection reset by peer) while reading response header from upstream
- 对于PHP引起的(104: Connection reset by peer) while reading response header from upstream错误解决方法
- recv() failed (104: Connection reset by peer) while reading response header from upstream
- nginx 错误502 upstream sent too big header while reading response header from upstream
- 关于FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream的一次解决过
- 使用nginx upstream upstream timed out while reading response header from upstream问题解决
- Nginx Upstream prematurely closed connection while reading upstream...
- "Primary script unknown" while reading response header from upstream, client: 192.168.1.102, server:
- upstream sent too big header while reading response header from upstream
- nginx log 错误502 upstream sent too big header while reading response header from upstream