Saturday, July 24, 2004

Apache VirtualHost and Proxies

This is surprisingly easy to set up. There is some help here, but it doesn't deal with combining both proxy and virtualhost directives (as of this writing).
Here's my example set up:
<VirtualHost *:*>
ProxyPreserveHost On
ProxyPass / http://192.168.111.2/
ProxyPassReverse / http://192.168.111.2/
ServerName bugzilla.mydomain.com
ServerAlias bugzilla.mydomain.com
</VirtualHost>

This can screw up if you're also doing proxy stuff to the same server outside of the VirtualHost block.