nginx: bind() to 123.123.123.123:80 failed (99: Cannot assign requested address)


Following error occurs on nginx restart, if the A Record of a Domain (sites-enabled) points to another IP as nginx is running on.

Nginx Host IP: 231.231.231.231
Domain IP (A Record) changed to: 123.123.123.123

nginx configtest (see nginx documentation / full command depends on host os)

Throws:

Testing nginx configuration: the configuration file /etc/nginx/nginx.conf syntax is
ok[emerg]: bind() to 123.123.123.123:80 failed (99: Cannot assign requested address)
configuration file /etc/nginx/nginx.conf test failed

Solution:

Remove linked Host Configuration File for related Domain and start nginx as usual.