Recently I had to integrate with a backend app using Apache as a reverse proxy. Ideally, and how I’ve done it a million times in the past, you are able to have the backend application respond on a particular host/port/path ( i.e. http://foo.example.com:1234/backend ). This makes setting up Apache via ProxyPass and ProxyPassReverse a snap.
ProxyPassReverse /backend/ http://foo.example.com:1234/backend/
So what happens when you can’t run the backend application on a specific context root? By that I mean it can only run at: http://foo.example.com:1234/.
mod_proxy_html will converted it to
To get this to work, add the following to httpd.conf
ProxyPass /backend/ http://foo.example.com:1234/
ProxyPassReverse /backend/ http://foo.example.com:1234/
ProxyHTMLURLMap http://foo.example.com:1234 /backend
ProxyHTMLURLMap / /backend/
ProxyHTMLURLMap /backend /backend