Plesk 10 nginx reverse proxy configuration
On older Plesk version (
websrvmng –set-http-port –port=8080
Starting with Plesk 10 this is not so easy since you have to edit a php file called /usr/local/psa/admin/conf/templates/default/domain/domainVirtualHost.php. In my case instead of :
domain->physicalHosting->ipAddress->address ?>:server->webserver->httpsPort : $VAR->server->webserver->httpPort ?>>
ServerName "domain->asciiName ?>:server->webserver->httpsPort : $VAR->server->webserver->httpPort ?>"
I’ve set :
<VirtualHost <?php echo $OPT[‘ipAddress’]->escapedAddress ?>:<?php echo $OPT[‘ssl’] ? 8043 : 8080 ?>>
ServerName “<?php echo $VAR->domain->asciiName ?>:<?php echo $OPT[‘ssl’] ? 8043 : 8080 ?>”
Where 8043 will be the new https port and 8080 will be the http port.
After this change I had to run :
Note that this is only for Plesk 10.x. On 9.x we used to have
After this make sure that the Apache server has set in its configuration files (/etc/httpd/conf/httpd.conf) Listen 8080 instead of Listen 80. Same thing for the /etc/httpd/conf.d/ssl.conf file, Listen 8043 instead of Listen 443.
Then you need to install nginx (yum install nginx) and download this zip file that these guys provided http://www.grafxsoftware.com/download/nginx/nginx_setup.zip. Furthermore you can check their http://www.grafxsoftware.com/faq.php/HOW-TO-configure-PLESK-with-NGinx-proxy-reverse/1/1/.
Once downloaded run:
Verify with “nginx -t” that there isn’t any error and finally restart the involved services :
service httpd restart
service nginx restart
Make sure that 8043 and 8080 accept connections. (Note that its not necessary to change the https port).