When I reboot my server (not nginx, the whole server), Nginx fails to start automatically. After I logged into the server, I can start nginx manually (service nginx start). It works. But if I restart again, I have to manually start Nginx. When checking the error.log for Nginx, I saw this error repeated several times :
2012/08/27 09:19:23 [emerg] 1066#0: bind() to [ipv6]:80 failed (99: Cannot assign requested address)
How can I fix this? What is this problem? (Im running an Ubuntu 12.04 server)
Best Answer
It sounds like your IPv6 address has just been assigned to eth0, and still be in the tentative state, thus Nginx cannot establish a listen on that IP.
Either turn of DAD (Duplicate Address Detection) by running:
(insert into
/etc/sysctl.conf
for permanent)or add this line into
/etc/network/interfaces
, under inet6 interface definitionSource: http://pyro.eu.org/how-to/micro/nginx-cannot-assign-requested-address-ipv6.txt