Assuming nginx is running on port 82 and you want to serve nginx.domain.com with nginx.
<VirtualHost *:80>
ServerAdmin me@mydomain.com
ServerName nginx.domain.com
ProxyPreserveHost On
# setup the proxy
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
ProxyPass / http://localhost:82/
ProxyPassReverse / http://localhost:82/
</VirtualHost>
http://serverfault.com/questions/195611/how-do-i-redirect-subdomains-to-a-different-port-on-the-same-server
Now let's reverse the roles, using Nginx as reverse proxy server and Apache as the real server:
https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-as-a-web-server-and-reverse-proxy-for-apache-on-one-ubuntu-14-04-droplet
No comments:
Post a Comment