Re: Видимо баг в debug режиме

slava slava at skitalets.ru
Wed Jul 11 12:30:47 MSD 2007




>> Почему nginx передает апачу запросы для домена www.ajaxline.com, когда секция server задана только для naikonsoft.com и www.naikonsoft.com?

Потому что
"Если в запросе нет заголовка "Host" или же в нём указано имя, неописанное ни в одном сервере, слушающем на адресе и порту, на которые пришёл запрос, то запрос будет обслужен сервером, у которого первым описаны эти адрес и порт. "

Что и как раз наблюдается в Вашем случае.


http://sysoev.ru/nginx/docs/virtual_hosts.html

  ----- Original Message ----- 
  From: Дмитрий Леоненко 
  To: nginx-ru at sysoev.ru 
  Sent: Wednesday, July 11, 2007 11:54 AM
  Subject: Видимо баг в debug режиме


  Конфиг такой:


  nsserver eng # cat /etc/nginx/nginx.conf
  user nginx nginx;
  worker_processes 1;


  error_log /var/log/nginx/error_log info;
  events {
          worker_connections  8192;
          use epoll;
  }


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


          log_format main
                  '$remote_addr - $remote_user [$time_local] ' 
                  '"$request" $status $bytes_sent '
                  '"$http_referer" "$http_user_agent" '
                  '"$gzip_ratio"'; 


          client_header_timeout   10m;
          client_body_timeout     10m;
          send_timeout            10m;


          connection_pool_size            256;
          client_header_buffer_size       1k;
          large_client_header_buffers     4 2k;
          request_pool_size               4k;


          gzip on;
          gzip_min_length 1100;
          gzip_buffers    4 8k;
          gzip_types      text/plain;


          output_buffers  1 32k;
          postpone_output 1460;


          sendfile        on;
          tcp_nopush      on;
          tcp_nodelay     on; 


          keepalive_timeout       75 20;


          ignore_invalid_headers  on;


          index index.html;


          server {
                  listen          10.4.80.208;
                  server_name     naikonsoft.com www.naikonsoft.com;


                  access_log      /var/log/nginx/www.naikonsoft.com.access_log main; 
                  error_log       /var/log/nginx/www.naikonsoft.com.error_log;
                  error_log       /var/log/nginx/debug debug;




                  location / {
                      proxy_pass  http://192.168.0.1;
                      proxy_redirect     off;
                      proxy_set_header   X-Real-Ip        $remote_addr; 
                      proxy_set_header   Host     $host;
                  }
          }
  }







-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx-ru/attachments/20070711/b147bb9f/attachment.html>


More information about the nginx-ru mailing list