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

前端之家收集整理的这篇文章主要介绍了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.从不使用操作系统设置.
原文链接:https://www.f2er.com/ubuntu/347684.html

猜你在找的Ubuntu相关文章