Nginx fails to fails: "nginx: [emerg] bind() to 203.0.113.2:443 failed

Started by mahesh, Nov 27, 2024, 06:50 AM

Previous topic - Next topic

mahesh

Question:
Nginx fails to fails: "nginx: [emerg] bind() to 203.0.113.2:443 failed (99: Cannot assign requested address)"
Symptoms
  • The server has been recently migrated
  • Nginx fails to start and the following error show up in Plesk panel:
  • New configuration files for the Apache web server were not created due to the errors in configuration templates: nginx: [emerg] bind() to 203.0.113.2:443 failed (99: Cannot assign requested address) nginx: configuration file /etc/nginx/nginx.conf test failed
  • The IP address 203.0.113.2 has been used during the migration, but is no longer present on the server nor Plesk

Cause
The file /etc/nginx/plesk.conf.d/server.conf still contains the 203.0.113.2 IP address.

Resolution
Recreate Nginx configuration file as below:

1.Connect to the server via SSH

2.Disable Nginx with the following command:

#/usr/local/psa/admin/sbin/nginxmng --disable
3.Enable Nginx back:

#/usr/local/psa/admin/sbin/nginxmng --enable