IPv6 enabled Nginx default bind port

kuisma nginx-forum at nginx.us
Sun Sep 27 13:26:05 MSD 2009


Igor Sysoev Wrote:
-------------------------------------------------------

> No, you just need to set:
> 
>      listen [::]:80  default ipv6only=on;
> 
> because Linux bind()s to both ipv4 and ipv6 by default.

Oh, how embarrassing, this is basically what you already said above ... Sorry 'bout that.

I found the most intuitive solution was binding to explicit addresses, not using the wild card [::], this way no conflicts occurred, trying to bind an IPv4 address when IPv6 asked.

The default ipv6only=yes worked as well, but a bit contra-intuitive. It might give the impression the entire server block is only to listen to IPv6, not only this listen directive exclusively. Also, the default keyword itself might be somewhat confusing; a local server block parameter affecting the global listen/bind parameters affecting all other server definitions. I'm actually not sure I understand it myself correctly.

I'll try to write something clarifying this in the wiki.

Thank you,
-- Kuisma

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






More information about the nginx mailing list