IPv6 enabled Nginx default bind port

Igor Sysoev is at rambler-co.ru
Sun Sep 27 11:52:04 MSD 2009

On Sun, Sep 27, 2009 at 03:33:15AM -0400, kuisma wrote:

> The opposite situation is also true. I tried out IPv6, but my first server definition did only use IPv4, making the later IPv6 enabled server definition fail to bind.
> 2009/09/27 09:12:41  30088#0: bind() to [::]:80 failed (98: Address already in use)
> 2009/09/27 09:12:41  30088#0: try again to bind() after 500ms
> Now after reading this posting, realizing I must enable it for all vhosts, but I really think this is an issue in need of at least documentation. Maybe I should add it to the English wiki.

No, you just need to set:

     listen [::]:80  default ipv6only=on;

because Linux bind()s to both ipv4 and ipv6 by default.

Igor Sysoev

More information about the nginx mailing list