Skip to content

Instantly share code, notes, and snippets.

@joergpatz
Last active February 4, 2016 21:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save joergpatz/96fec2b2e18c94477fd1 to your computer and use it in GitHub Desktop.
Save joergpatz/96fec2b2e18c94477fd1 to your computer and use it in GitHub Desktop.
apache-proxy-vhost
# Forward Proxy
<VirtualHost *:80>
ServerAdmin admin@localhost
RewriteEngine On
ProxyPreserveHost On
RewriteRule ^/(.*) http://<HOST-OR-IP>/$1 [P]
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
</VirtualHost>
# Reverse Proxy e.g. NODEJS Server
<VirtualHost *:80>
ServerAdmin admin@localhost
ServerName example.com
ProxyRequests off
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
<Location />
ProxyPass http://localhost:3100/
ProxyPassReverse http://localhost:3100/
</Location>
</VirtualHost>
<VirtualHost *:80>
ProxyPreserveHost On
ProxyRequests Off
ProxyPass / http://<HOST-OR-IP>/
ProxyPassReverse / http://<HOST-OR-IP>/
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment