【发布时间】:2013-04-15 00:43:39
【问题描述】:
我有用于 Python Django 应用的 Nginx + uWSGI。
我的nginx.conf 中有以下内容:
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:9001;
uwsgi_read_timeout 1800;
uwsgi_send_timeout 300;
client_header_timeout 300;
proxy_read_timeout 300;
index index.html index.htm;
}
但是对于 uWSGI 上的长时间运行请求,大约需要 1 分钟才能完成,我在 Nginx 错误日志中收到超时错误,如下所示:
2013/04/22 12:35:56 [error] 2709#0: *1 upstream timed out (110: Connection timed out) while reading response header from upstream, client: xx.xx.xx.xx, server : ,请求:“GET /entity/datasenders/HTTP/1.1”,上游:“uwsgi://127.0.0.1:9001”,主机:“xxx.xx.xx.x”
我已经将标头超时和 uWSGI 发送/读取超时设置为 5 分钟,有人可以告诉我如何解决这个问题吗?
【问题讨论】:
标签: nginx configuration uwsgi connection-timeout