页次: 1
没有任何其他程序占用80端口,而是nginx自己先绑定了80端口,又重复绑定而造成的。有些人建议在nginx.conf文件中添加
listen [::]:80;
而事实上这种做法会导致重复绑定:
Starting nginx daemon: nginx[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: still could not bind()
nginx already running.
在Nginx论坛看到的,同时绑定IPv4和IPv6地址时应当写为:
listen 80;
listen [::]:80 ipv6only=on;
重启Nginx即可。
离线
页次: 1