удаление sock файла

Viatcheslav E. Kouznetsov slava at auto.ru
Mon Dec 22 09:41:49 MSK 2008


Добрый день всем!
Вопрос внутренностям nginx'а..

Как поведет (или как должен повести)
себя nginx , если по какой-то (неважно какой)
причине будет удален sock файл, а потом
восстановится снова (будет перезапущен бекенд) ?


--------------------nginx.conf------------------
user  nobody;
worker_processes 4;
worker_rlimit_nofile 16384;
error_log  /usr/logs/nginx.err;

pid        /var/run/nginx.pid;

events {
  use epoll; # Linux ONLY!!
  worker_connections  16384;
}

http {
  include       mime.types;
  default_type  application/octet-stream;

  log_format  main  '$host $remote_addr - $remote_user [$time_local] '
                    '$request "$status" $body_bytes_sent ';

  access_log /dev/null;

  sendfile        on;
  tcp_nopush     off;
  tcp_nodelay     on;

  keepalive_timeout  30;
  reset_timedout_connection  on;
  server_names_hash_bucket_size 128;

  gzip  on;
  geo $geo_info {
    include /servers/sysconfig/nginx+fcgi/nginx_geo.conf;
  }

  upstream php-fpm {
    server unix:/tmp/php-fpm.sock;
    server unix:/tmp/php-fpm1.sock;
    server unix:/tmp/php-fpm2.sock;
    server unix:/tmp/php-fpm3.sock;
  }

  server {
    listen       *:80 default backlog=16384;
    server_name  auto.ru *.auto.ru;

    access_log  /usr/logs/cgi.log main;
    error_log /usr/logs/cgi.err;

    location / {
      fastcgi_pass php-fpm;
      fastcgi_param  SCRIPT_FILENAME  /servers/lib5/index.php;
      include /servers/sysconfig/nginx+fcgi/fastcgi_params;
    }

    error_page 404 500 502 503 504  /50x.html;
    location = /50x.html {
      root   /servers/nginx/WWW;
    }
    location /images/ {
      root   /servers/nginx/images;
    }
    location /favicon.ico {
      proxy_pass       http://img.auto.ru;
      proxy_set_header Host      $host;
      proxy_set_header X-Real-IP $remote_addr;
    }
    location /robots.txt {
      proxy_pass       http://img.auto.ru;
      proxy_set_header Host      $host;
      proxy_set_header X-Real-IP $remote_addr;
    }
  }
}

---------------fastcgi_params-----------------

fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;

fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;
fastcgi_param  GEO_INFO		  $geo_info;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param  REDIRECT_STATUS    200;


-- 
С уважением,
	Вячеслав Кузнецов
	ООО "АВТО.РУ"
	тел. 8(499)730-8-730 (доб. 112)





More information about the nginx-ru mailing list