nginx 报错 upstream timed out (110: Connection timed out)解决方案


一、nginx 作PHP的web接口服务器,在线上发现时不时经常崩溃。504,导致接口访问无响应回复。

    查看日志:

[error] 11618#0: *324911 upstream timed out (110: Connection timed out) while reading response header from upstream,  client:

解决方法:
[root@m2 vhosts]# cat nginx.conf
server {
    	listen 80;
        server_name zabbix.gree.com;
        access_log /roobo/logs/nginx/zabbix.gree.com_access.log main;
        error_log /roobo/logs/nginx/zabbix.gree.com_error.log error ;
    	root /roobo/webserver/zabbix;
    	index index.html index.htm index.php;

    	location / {
        	try_files $uri $uri/ /index.php$is_args$args;
    	}
    	location ~ \.php$ {
        	try_files $uri =404;
        	include fastcgi.conf;
        	fastcgi_pass 10.7.19.195:9000;
        }

 #error Connection timed out and 504 error large_client_header_buffers 4 16k; client_max_body_size 30m; client_body_buffer_size 128k; fastcgi_connect_timeout 300; fastcgi_read_timeout 300; fastcgi_send_timeout 300; fastcgi_buffer_size 64k; fastcgi_buffers 4 32k; fastcgi_busy_buffers_size 64k; fastcgi_temp_file_write_size 64k;
}
在server标签内增加k下内容
       #error Connection timed out and 504 error
       large_client_header_buffers 4 16k;
       client_max_body_size 30m;
       client_body_buffer_size 128k;
       fastcgi_connect_timeout 300;
       fastcgi_read_timeout 300;
       fastcgi_send_timeout 300;
       fastcgi_buffer_size 64k;
       fastcgi_buffers   4 32k;
       fastcgi_busy_buffers_size 64k;
       fastcgi_temp_file_write_size 64k;
再重启nginx服务。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM