IPv4 & IPv6 combination

Peleke nginx-forum at nginx.us
Fri Feb 7 14:21:38 UTC 2014


I have a virtual server with Debian Wheezy and nginx 1.4.4 installed:

nginx version: nginx/1.4.4
TLS SNI support enabled
configure arguments: --prefix=/usr/share/nginx
--conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log
--http-client-body-temp-path=/var/lib/nginx/body
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi
--http-log-path=/var/log/nginx/access.log
--http-proxy-temp-path=/var/lib/nginx/proxy
--http-scgi-temp-path=/var/lib/nginx/scgi
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi --lock-path=/var/lock/nginx.lock
--pid-path=/run/nginx.pid --with-pcre-jit --with-debug --with-file-aio
--with-http_addition_module --with-http_dav_module --with-http_flv_module
--with-http_geoip_module --with-http_gzip_static_module
--with-http_gunzip_module --with-http_image_filter_module
--with-http_mp4_module --with-http_perl_module
--with-http_random_index_module --with-http_realip_module
--with-http_secure_link_module --with-http_spdy_module
--with-http_stub_status_module --with-http_ssl_module --with-http_sub_module
--with-http_xslt_module --with-ipv6 --with-mail --with-mail_ssl_module
--add-module=/usr/src/nginx/source/nginx-1.4.4/debian/modules/headers-more-nginx-module
--add-module=/usr/src/nginx/source/nginx-1.4.4/debian/modules/nginx-auth-pam
--add-module=/usr/src/nginx/source/nginx-1.4.4/debian/modules/nginx-cache-purge
--add-module=/usr/src/nginx/source/nginx-1.4.4/debian/modules/nginx-dav-ext-module
--add-module=/usr/src/nginx/source/nginx-1.4.4/debian/modules/nginx-development-kit
--add-module=/usr/src/nginx/source/nginx-1.4.4/debian/modules/nginx-echo
--add-module=/usr/src/nginx/source/nginx-1.4.4/debian/modules/ngx-fancyindex
--add-module=/usr/src/nginx/source/nginx-1.4.4/debian/modules/nginx-push-stream-module
--add-module=/usr/src/nginx/source/nginx-1.4.4/debian/modules/nginx-lua
--add-module=/usr/src/nginx/source/nginx-1.4.4/debian/modules/nginx-upload-progress
--add-module=/usr/src/nginx/source/nginx-1.4.4/debian/modules/nginx-upstream-fair
--add-module=/usr/src/nginx/source/nginx-1.4.4/debian/modules/nginx-syslog
--add-module=/usr/src/nginx/source/nginx-1.4.4/debian/modules/ngx_http_pinba_module
--add-module=/usr/src/nginx/source/nginx-1.4.4/debian/modules/ngx_http_substitutions_filter_module
--add-module=/usr/src/nginx/source/nginx-1.4.4/debian/modules/ngx_pagespeed
--add-module=/usr/src/nginx/source/nginx-1.4.4/debian/modules/nginx-x-rid-header
--with-ld-opt=-lossp-uuid

Now I want to allow IPv4 AND IPv6 connections at the same time. 
sudo sysctl net.ipv6.bindv6only
net.ipv6.bindv6only = 0

My default.conf looks like this:

# ---------------------------------------
# vHost default
# ---------------------------------------
 
server {
 
    ##
    # Deny Direct Access
    ##
 
    #listen 80 default_server;
    listen [::]:80 default_server;# ipv6only=on;
    server_name _;
    return 444;
}

and my domain.conf looks like this:

server {

    ##
    # Basic Settings
    ##
    
    #listen 80;
    listen [::]:80;
    server_name  domain.tld www.domain.tld;

When I want to restart nginx I get

peleke at vps:~$ sudo /etc/init.d/nginx restart
[....] Restarting nginx: nginxnginx: [emerg] bind() to [::]:80 failed (98:
Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()

How can I test if my domain is reachable for everyone on IPv4 AND IPv6? I
have only a native IPv6 connection so I cannot check for IPv4.

Thanks

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



More information about the nginx mailing list