Sunday, January 29, 2017

using apache/nginx as reverse proxy server (map to different ports based on domain name)

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>

No comments:

Blog Archive