ipv6 是否有 net.ipv4.ip_nonlocal_bind 等价物?需要在这样的 IP 上启动我的 nginx ......
尽管有这个 /etc/network/interface ,我的 Ubuntu 没有足够快地在 eth0 上分配这个 IPv6 :
iface eth0 inet6 static
address 1:2:3:4::5
netmask 64
Run Code Online (Sandbox Code Playgroud)
在启动期间:
Starting nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
[emerg]: bind() to [1:2:3:4::5]:80 failed (99: Cannot assign requested address)
Run Code Online (Sandbox Code Playgroud)
我需要/etc/init.d/nginx restart在启动后运行几秒钟才能使事情正常工作:-/
注意:1:2:3:4::5 在这里仅用于演示,我的服务器上有一个有效的 IPv6 地址。