听老歌 发表于 2011-09-26 21:51

nginx 端口监听BUG

nginx 端口监听BUG


nginx.conf 配置如下:

server

{
         
server_name_;#default
         
return 444;
   
}

####################################################################

server

{

listen       10.121.25.88:80;
   
server_namewww.test.com;
   
index default.html index.html;
   
root/www/www.test.com;
                includerewrite/www.test.com;

includestatic.conf;
   
log_formatwww.test.com '$remote_addr - $remote_user [$time_local] "$request" '
      
'$status $body_bytes_sent "$http_referer" '
            
'"$http_user_agent" $http_x_forwarded_for';
   
access_log/data1/logs/www.test.com.logwww.test.com;
      
}


#####################################################################

server

{

listen       10.121.25.89:88;
   
server_namewww.domin.com;
   
index default.html index.html;
   
root/www/www.domin.com;
                includerewrite/www.domin.com;

includestatic.conf;
   
log_formatwww.domin.com '$remote_addr - $remote_user [$time_local] "$request" '
      
'$status $body_bytes_sent "$http_referer" '
            
'"$http_user_agent" $http_x_forwarded_for';
   
access_log/data1/logs/www.domin.com.logwww.domin.com;
      
}


但是我用www.test.com:88也能访问并且是www.domin.com下的内容
nginx的监听如下:
tcp      0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      20102/nginx: worker keepalive (0.00/0/0)
tcp      0      0 0.0.0.0:88                  0.0.0.0:*                   LISTEN      20102/nginx: worker off (0.00/0/0)


从上可以看出nginx并没有对每个IP进行单独的端口监听 而是监听所有IP下的80和88端口导致访问www.test.com:88端口时返回www.domin.com的内容
这个有什么办法可以规避吗???
页: [1]
查看完整版本: nginx 端口监听BUG