IP-based virtual hosts do not work properly when Nginx is enabled


2016-11-16 13:09:54 UTC


2017-08-16 17:17:19 UTC


Was this article helpful?

Have more questions?

Submit a request

IP-based virtual hosts do not work properly when Nginx is enabled

Applicable to:

  • Plesk 11.x for Linux


When Nginx is enabled, IP-based virtual hosts (default domains on an IP) do not work properly if more than one IP has a default domain assigned.

A domain is shown instead of Plesk default server page .


When Nginx makes an IP-based proxy request, it connects to Apache on the address and sends the request. This means that from Apache's point of view, all virtual hosts are on the same IP address – – which causes IP-based virtual hosts to work improperly.

That is, the first virtual host defined in the /usr/local/psa/admin/conf/ip_vhosts_bootstrap.conf file becomes the default on all IP addresses, including those which do not have a default domain assigned.

This is a software issue with internal ID #PPPM-269 . The issue will be fixed in a future update for which a new Knowledgebase article will be created. You may subscribe to new articles on Plesk products if you wish to receive notifications about their creation.


As a workaround, you may use following instructions.

  1. Go to the /usr/local/psa/admin/conf/templates directory:

    # cd /usr/local/psa/admin/conf/templates
  2. Create a sub-directory called custom .

    # mkdir custom
  3. Copy the /usr/local/psa/admin/conf/templates/default/nginx.php file to the custom directory:

    # cp default/nginx.php custom/
  4. Edit the nginx.php file by replacing with $host or $server_addr

    # vi custom/nginx.php
  5. You should get the following as a result:

    proxy_pass http://$server_addr:<?php echo $VAR->server->webserver->httpPort ?>;
  6. Rebuild the web-server configuration:

    /usr/local/psa/admin/sbin/httpdmng --reconfigure-all
Have more questions? Submit a request
Please sign in to leave a comment.