nginx 0.8.42: все еще теряет v6 сокеты при релоаде?
Alexander V. Chernikov
melifaro на ipfw.ru
Ср Июн 30 01:35:13 MSD 2010
# pkg_info -xI nginx
nginx-devel-0.8.42 Robust and small WWW server
# cat /usr/local/etc/nginx/nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local]
"$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx-access.log main;
sendfile on;
keepalive_timeout 65;
server {
listen 80; listen [::]:80;
server_name host1;
location / { root /test/vhost1; }
}
server {
listen 8080; listen [::]:8080;
server_name host2;
location / { root /test/vhost2; }
}
}
# /usr/local/etc/rc.d/nginx start
Performing sanity check on nginx configuration:
the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
configuration file /usr/local/etc/nginx/nginx.conf test is successful
Starting nginx.
# sockstat -46| grep nginx
www nginx 76260 6 tcp4 *:80 *:*
www nginx 76260 7 tcp6 *:80 *:*
www nginx 76260 8 tcp4 *:8080 *:*
www nginx 76260 9 tcp6 *:8080 *:*
root nginx 76259 6 tcp4 *:80 *:*
root nginx 76259 7 tcp6 *:80 *:*
root nginx 76259 8 tcp4 *:8080 *:*
root nginx 76259 9 tcp6 *:8080 *:*
1:25 [1] ws# /usr/local/etc/rc.d/nginx reload
Performing sanity check on nginx configuration:
the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
configuration file /usr/local/etc/nginx/nginx.conf test is successful
1:26 [1] ws# sockstat -46| grep nginx
www nginx 76274 6 tcp4 *:80 *:*
www nginx 76274 7 tcp6 *:80 *:*
www nginx 76274 8 tcp4 *:8080 *:*
root nginx 76259 6 tcp4 *:80 *:*
root nginx 76259 7 tcp6 *:80 *:*
root nginx 76259 8 tcp4 *:8080 *:*
Все, [::]:8080 пропало.
Triggered на
FreeBSD 8.0-RELEASE amd64
FreeBSD 7.2-STABLE i386
Кроме того (видимо именно из-за исчезающего порта) (первый?) vhost с
этого "исчезнувшего" порта становится основным и единственным доступным
по v6
Триггерится опять же этой же конфигурации примерно так:
# egrep 'host[12]' /etc/hosts
::1 host1
::1 host2
127.0.0.1 host1
127.0.0.1 host2
# fetch -4qo- http://host1/test.txt
=======================
| *** HOST1 *** |
=======================
# fetch -6qo- http://host1/test.txt
=======================
| *** HOST1 *** |
=======================
# /usr/local/etc/rc.d/nginx reload
Performing sanity check on nginx configuration:
the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
configuration file /usr/local/etc/nginx/nginx.conf test is successful
# fetch -4qo- http://host1/test.txt
=======================
| *** HOST1 *** |
=======================
# fetch -6qo- http://host1/test.txt
=======================
| ??? HOST2 ??? |
=======================
Подробная информация о списке рассылки nginx-ru