PLESK – NGINX: Cannot assign requested address – during migration not only to Azure

When you trying to move PLESK solution to Azure, but probably not only to Azure and not only PLESK, but also other services based on NGINX you can see this kind of error:

NGINX: Cannot assign requested address.

It is occurred during changing IP address (using plesk bin reconfigurator command described here: https://support.plesk.com/hc/en-us/articles/115001761193-How-to-change-the-IP-address-of-Plesk-server-). To resolve it please add the following line:

net.ipv4.ip_nonlocal_bind = 1

to /etc/sysctl.conf

and run sysctl -p /etc/sysctl.conf.

Sometime especially if you see postfix/smtp Invalid argument error please run:

/usr/local/psa/admin/sbin/mchk –with-spam

It will rebuild postfix malware database and restart postfix.

 

PS: During changing IP address please check /etc/host file also.