zoukankan      html  css  js  c++  java
  • 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服务。

  • 相关阅读:
    第五,六章
    第三,四章
    第一,二章
    20131019作业 2 分支、循环结构
    20131016课堂实验4
    20131014课堂实验3
    20131007国庆作业例7-11,7-12,7-13,7-14
    20131006国庆作业例7-7,7-8,7-9
    20131006国庆作业例7-4,7-5,7-6
    20131006国庆作业第七章例7-1,7-2,7-3
  • 原文地址:https://www.cnblogs.com/nulige/p/10156903.html
Copyright © 2011-2022 走看看