3

In my nginx (1.4.2) setup on Ubuntu 12.04, I have set up only one configuration file (I deleted/disabled the others):

server {
  listen [::]:80 default_server;

  location / {
    root /home/lwood/websites/default/public;
  }
}

I have restarted nginx.

Why does nginx not accept IPv4 connections? Here are the docs

http://wiki.nginx.org/HttpCoreModule#listen

They mention that

In Linux by default any IPv6 TCP socket also accepts IPv4 traffic ... the runtime parameter: net.ipv6.bindv6only which has the value 0 by default.

I have checked with sysctl, bindv6only is indeed set to 0. So my IPv6 listen directive should accept IPv4 as well, right?

I must be misunderstanding the docs. An explanation would be appreciated.

lwood
  • 65
  • 1
  • 5

1 Answers1

5

The wiki is out of date. As specified in the actual documentation, the default for ipv6only is on since nginx 1.3.4. If you omit the parameter, then nginx will only bind to IPv6. The OS settings are never used.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940