2

I have a centos server with nginx running on it. The server ip recently changed and nginx no longer starts up

it gives the following error message where 123.123.123.123. is the old ip address of the server

Starting nginx: nginx: [emerg] bind() to 123.123.123.123:80 failed (99: Cannot assign requested address)

Where is it reading the old IP address from?

Qwerty.ie
  • 131
  • 1
  • 3
  • Fix the nginx configuration. – Michael Hampton Jul 16 '15 at 17:33
  • nginx configuration looks ok. the folder /etc/nginx/conf.d has a config file for the new IP address and none for the old IP adddress. Is there something else that needs to be configured for nginx? – Qwerty.ie Jul 16 '15 at 17:36
  • Did you verify that all of the sites are set to listen on the correct address? Does `/etc/nginx/sites-available/example.com` contain something like `listen 172.30.0.42:80;` or more specifically does not contain `listen 123.123.123.123:80;` – Matt Jul 16 '15 at 17:49
  • there is no /etc/nginx/sites-available folder. There's an /etc/nginx/conf.d folder with the conf file for the ip address. – Qwerty.ie Jul 16 '15 at 18:24
  • Are there any config files inside `/etc/nginx/`? Have you ensured that those and included configuration files from those files have been updated with the new IP address? – Tero Kilkanen Jul 16 '15 at 21:53

1 Answers1

2

Yes, paths to check seems to be:

/etc/nginx/conf.d/

/etc/nginx/sites-available/

Maybe the Nginx configuration files are also in different directory. I had these in /home/admin/conf/web (VestaCP control panel?)

Then do "service nginx restart" command.

16851556
  • 436
  • 2
  • 7
  • 19