我在运行Django和Gunicorn(19.6.0)后面Nginx(1.6.2)。 一切工作正常,一个小问题。 如果我发送一个JSON有效负载大于10KB的POST请求和Django答复500er我在Chrome中得到一个net::ERR_INCOMPLETE_CHUNKED_ENCODING和响应是空的,虽然Django发送一个JSONstring{"error":"some error description"} 。
Nginx日志显示104: Connection reset by peer :
如果POST请求的有效负载很小,我会得到预期的结果。 如果我发送相同的请求(也与大有效载荷)直接gunicorn发生错误,我得到了预期的回应。
我的Nginxconfiguration:
server { listen 80 default_server; server_name _; client_max_body_size 10m; location /static/ { root /srv/yyyyy; } location /media/ { root /srv/yyyyy; } # Proxy Pass to Gunicorn location / { include proxy_params; proxy_pass http://unix:/srv/yyyyy/proxy_pass.sock; } }
我也testing了一下proxy_buffering off; 在位置块,但仍然是相同的结果。