ubuntu – 为什么这个IPv6 listen指令也不接受IPv4?

在我的Ubuntu 12.04上的nginx(1.4.2)设置中,我只设置了一个配置文件(我删除/禁用了其他配置文件):

server {
  listen [::]:80 default_server;

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

我重新启动了nginx.

为什么nginx不接受IPv4连接?这是文档

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

他们提到这一点

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.

我已经用sysctl检查过,bindv6only确实设置为0.所以我的IPv6 listen指令也应该接受IPv4,对吗?

我一定是误解了文档.一个解释将不胜感激.

最佳答案
维基已经过时了.如the actual documentation中所指定,自nginx 1.3.4起,ipv6only的默认值为on.如果省略该参数,则nginx将仅绑定到IPv6.从不使用操作系统设置.

dawei

【声明】:唐山站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。