upstream timed out (110: Connection timed out)

devdemi nginx-forum at nginx.us
Tue Sep 20 15:32:36 UTC 2011


I installed on Debian Lenny nginx 0.6.32 and php-fpm and php file opens
as well but went trying to do post request i get error in my
/var/log/nginx/error.log
"upstream timed out (110: Connection timed out) while reading response
header from upstream, ....."
My config of host
----------------------
server {
  listen 80;
  server_name domain.ru www.domain.ru;

  set $www_folder '/var/www';
  set $root_path '$www_folder';
  root $root_path;
  index index.htm index.html index.php;

  location ~ \.php$ {
        include /etc/nginx/fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $root_path/$fastcgi_script_name;
        fastcgi_param DOCUMENT_ROOT $root_path;
        fastcgi_pass php-fpm;
  }
  location @phpscripts {
        include /etc/nginx/fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $root_path/$fastcgi_script_name;
        fastcgi_param DOCUMENT_ROOT $root_path;
        fastcgi_pass php-fpm;
  }

  location / {
     default_type text/html;
     root  $root_path;

     if (!-e $request_filename) {
        return 404;
     }

     error_page      404 502 504 403 405 = @php;
  }

  location @php {
        include /etc/nginx/fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $root_path/index.php;
        fastcgi_pass php-fpm;
  }

  error_page    502 = /502.htm;
  location = /502.htm {
         root  $www_folder;
  }  

  location ~* \.(css|js|swf|ico|png|jpg|gif|jpeg|mp3|xml|html)$ {
        root  $root_path;
        access_log   off;
        expires      30d;
  }

  location ~ /\.ht {
        deny  all;
  }

  location ~ /.svn/ {
        deny all;
  } 

}
----------------------
and my /etc/nginx/nginx.conf
----------------------
worker_processes  6;
# worker_priority -1;

error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;

events {
    worker_connections  5024;
    # multi_accept on;
}

http {
    include       /etc/nginx/mime.types;

    access_log  /var/log/nginx/access.log;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    tcp_nodelay        on;

    gzip  on;
    gzip_disable "MSIE [1-6]\.(?!.*SV1)";

        # PHP-FPM (backend)
        upstream php-fpm {
           server 127.0.0.1:9000;
        }


    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}
----------------------

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215447,215447#msg-215447



More information about the nginx mailing list