I've tried to setup nginx on my brand new linux-server together with Plesk 10.3 (latest) and created a new nginx subdomain for port 8226 - how can I configure Plesk to use nginx as a server for my subdomain created in Plesk?

link|improve this question
feedback

1 Answer

up vote 2 down vote accepted

You are looking for a so called "reversed proxy". You do not need to create another subdomain in your Plesk-Panel.

Just tell your apache, to proxy all requests from sub.mydomain.com to your predefined nginx-port (8226).

Create a new file nginx.conf and save it under /etc/httpd/conf.d/

<VirtualHost 123.123.123.123:80>

ServerName "sub.mydomain.com:80"
UseCanonicalName Off
ServerAlias  "sub.mydomain.com"

ProxyPreserveHost On
ProxyPass / http://sub.mydomain.com:8226/
ProxyPassReverse / http://sub.mydomain.com:8226/
ServerName sub.mydomain.com

</VirtualHost>

Reload apache service httpd reload

For further questions, I advise you to read the official Apache Virtual Host Documentation.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.