[Solved] Nginx proxy Timeout: upstream timed out (110: Connection timed out)

Environment
Server: centos6.4
Service: nginx proxy

Problem description.

Then look for /opt/usr/nginx/1.4.0/logs error error.log log prompt as follows

2015/01/04 15:44:13 [error] 10112#0: *994662 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 117.32.232.172, server: localhost, request: “POST /community-platform/datastatistics/datastatistics_exportAllUserDataDetail.action HTTP/1.1”, upstream: “http://10.172.11.194:9080/community-platform/datastatistics/datastatistics_exportAllUserDataDetail.action”, host: “admin.zhsqcn.com”, referrer: “http://admin.zhsqcn.com/community-platform/datastatistics/datastatistics_communityStatistics.action?leftPid=98”
2015/01/04 15:45:22 [info] 10112#0: *994692 client closed connection while waiting for request, client: 117.32.232.172, server: 0.0.0.0:80

2015/01/04 15:57:10 [info] 10112#0: *994707 client 1.85.57.66 closed keepalive connection
2015/01/04 15:57:19 [info] 10112#0: *994711 client 1.85.57.66 closed keepalive connection
2015/01/04 15:57:19 [info] 10112#0: *994718 client closed connection while waiting for request, client: 1.85.57.66, server: 0.0.0.0:80

Solution: vi /opt/usr/nginx/1.4.0/conf/nginx.conf
The reason is that the nginx proxy timeout is too short
proxy_connect_timeout 3;
proxy_read_timeout 30;
proxy_send_timeout 30;

Change to

proxy_connect_timeout 600;
proxy_read_timeout 600;
proxy_send_timeout 600;

Then just restart nginx:

/opt/usr/nginx/1.4.0/sbin/nginx -s reload

Similar Posts: