Andrew Andrew - 1 year ago 103
Apache Configuration Question

ProxyHTML to rewrite URL

I've got 2 apache servers set up. One on port 80 and another on port 8077. I'm wanting to see everything on the server on 8077 via a reverse proxy. At the moment I've got:

ProxyPreserveHost Off
ProxyHTMLInterp On
ProxyPass /translate/
ProxyPassReverse /translate/
ProxyHTMLURLMap / /translate/

This allows me to get to the initial page of the site, but the links to images, css and other pages don't work.

For example the css in the html shows as


where I actually want it to be


For it to pick up the file from the 8077 server. What can I do with the current setting to get that to work?

Answer Source

Ok, this is what I ended up doing to get it working

ProxyPass /translate/
ProxyPassReverse /translate/

ProxyHTMLURLMap /translate/

<Location /translate/>
   ProxyPassReverse /
   SetOutputFilter  proxy-html
   ProxyHTMLURLMap /translate/
   ProxyHTMLURLMap / /translate/
   ProxyHTMLURLMap  /translate/ /translate/
   RequestHeader    unset  Accept-Encoding

This seems to work well. The ProxyHTMLURLMap /translate/ line was only needed to translate some "referrer" based urls that caused some pages to end up trying to serve directly from the 8077 port server.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download