Unable to start or enable nginx as proxy: 99: Cannot assign requested address

Created:

2016-11-16 13:12:43 UTC

Modified:

2017-08-16 17:02:54 UTC

1

Was this article helpful?


Have more questions?

Submit a request

Unable to start or enable nginx as proxy: 99: Cannot assign requested address

Applicable to:

  • Plesk for Linux

Symptoms

  1. Unable to start or enable an nginx service:

    # /usr/local/psa/admin/bin/nginxmng -e
    [2015-04-25 16:38:28] ERR [util_exec] proc_close() failed
    [2015-04-25 16:38:34] ERR [util_exec] proc_close() failed
    [2015-04-25 16:38:34] ERR [panel] Apache config (14299906990.63406700) generation failed: Template_Exception: nginx: [emerg] bind() to 203.0.113.2:80 failed (99: Cannot assign requested address)
    nginx: configuration file /etc/nginx/nginx.conf test failed
  2. An IP address 203.0.113.2 is no longer present on the server or has been removed from Plesk.

Cause

One of subscriptions which had been removed earlier was assigned to the IP address 203.0.113.2.

However, due to an incomplete removal, web server configuration files for this subscription remain on the server and cause nginx configuration test failure.

Resolution

  1. Find a location and a domain to which orphaned configuration files belong:

    # grep -lr '203.0.113.2' /var/www/vhosts/system/ /etc/
  2. Find orphaned symbolic links using domain name from the search above:

    # find /etc/nginx/plesk.conf.d/* -name *example.com*
  3. Remove orphaned configuration files and symbolic links from the search above.

  4. Rebuild webserver configuration files:

    # /usr/local/psa/admin/bin/httpdmng --reconfigure-all

WARNING: Note that executing of such command removes all existing Apache configuration files before recreating them, so in case of huge amount of domains it can cause significant downtime.

  • Additionally, it is possible to rebuild nginx configuration files by re-enabling service in Plesk > Tools & Settings > Services Management - Reverse Proxy Server (nginx) or using the commands:
    # /usr/local/psa/admin/bin/nginxmng -d
    # /usr/local/psa/admin/bin/nginxmng -e
Have more questions? Submit a request
Please sign in to leave a comment.