apache reverse proxy: how to forward proxy server's HTTP_HOST

Ethan picture Ethan · Apr 14, 2012 · Viewed 8.5k times · Source

Our local development setup requires a box in the DMZ, and each developer has a line in its apache config for proxying. Looks something like:

ProxyPreserveHost on

ProxyPass /user1/ {user1's IP}
ProxyPassReverse /user1/ {user1's IP}

ProxyPass /user2/ {user2's IP}
ProxyPassReverse /user2/ {user2's IP}

#etc

Our public URLs become {DMZ server}/user1, {DMZ server}/user2, etc. The problem is that on the dev's boxes, the value of $_SERVER['HTTP_HOST'] is just {DMZ server}, without the user's subdirectory. The desired behavior is to have /user%/ as the real host name.

I've tried overriding the HOST var, and some rewrite rules, but nothing has worked.

Creating subdomains is not an option.

thank you for any help!