Nginx failed to start. Cannot assign requested address?

bind() to [ipv6]:80 failed (99: Cannot assign requested address)

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:

sysctl -w net.ipv6.conf.eth0.dad_transmits=0

(insert into /etc/sysctl.conf for permanent)

or add this line into /etc/network/interfaces, under inet6 interface definition

post-up while ip -6 addr show tentative | grep . > /dev/null ; do sleep 1 ; done

Source: http://pyro.eu.org/how-to/micro/nginx-cannot-assign-requested-address-ipv6.txt

Tags:

Nginx

Ubuntu