nginx(error.log):NginX upstream timed out (110: Connection timed out) while connecting to upstream 
http error:Nginx 502 Bad Gateway
php-fpm.log:php-fpm execution timed out (12898.552353 sec), terminating

Nginx才安装的,服务器上基本没流量,可访问php时却一直出现http 504错误,以下是解决办法:
I found answer on my posting on nginx forum - http://forum.nginx.org/read.php?2,127854
The answer is in my case was to set:
request_terminate_timeout=30s
in php-fpm config.
Note, you can use values other than 30s also.
I used it to match my value in main php.ini file which is:
max_execution_time = 30
Thanks All. :-)
其它解决办法:
504 Gateway Time-out问题常见于使用nginx作为web server的服务器的网站
我遇到这个问题是在升级discuz论坛的时候遇到的
一般看来, 这种情况可能是由于nginx默认的fastcgi进程响应的缓冲区太小造成的, 这将导致fastcgi进程被挂起, 如果你的fastcgi服务对这个挂起处理的不好, 那么最后就极有可能导致504 Gateway Time-out
现在的网站, 尤其某些论坛有大量的回复和很多内容的, 一个页面甚至有几百K
默认的fastcgi进程响应的缓冲区是8K, 我们可以设置大点
在nginx.conf里, 加入:
fastcgi_buffers 8 128k
这表示设置fastcgi缓冲区为8×128k
当然如果您在进行某一项即时的操作, 可能需要nginx的超时参数调大点, 例如设置成60秒
send_timeout 60;

http://blogread.cn/it/article.php?id=5448

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐