In the config' /etc/nginx/sites-enabled/default, the directives listen are like 
this:
        listen 80;
        listen [::]:80 default_server;

But I found this in the nginx doc' 
(http://wiki.nginx.org/HttpCoreModule#listen),
" When you enable the address [::]:80, binding port 80 using IPv6, in the 
listen directive, in Linux, by default, the IPv4 port 80 is also enabled. 
Meaning that nginx listens for both IPv4 and IPv6 incoming traffic. Therefore 
if you erroneously specify also a IPv4 address you'll get an already bind 
address error when reloading nginx configuration. "

SOLUTION 1
- remove directive "liste 80;",
(pay attentioon if you need to set up a second virtual host, you will have to 
separate IPv4 and IPv6 stacks; see solutions 2 and 3)

SOLUTION 2:
- separate IPv4 and v6 stacks using net.ipv6.bindv6only and set its value to 1.

SOLUTION 3:
- separate IPv4 and v6 stacks using the ipv6only option and replace this line:
-       listen [::]:80 default_server;
+       listen [::]:80 default_server ipv6only=on;

I personnaly use the third solution.
-- 
Jean-Marc <jean-m...@6jf.be>

Attachment: pgpPietrvErAU.pgp
Description: PGP signature

Reply via email to