apache2 Reverse Proxy URL mapping will not apply
My eventual goal is to use an existing Apache2 server that we use to reverse proxy to our development servers to also map to the web UI for the vm hosts behind our firewall as well.
I can get the proxy to load the page for a single server, and for the cluster (using a different config w/ a balancer), but I cannot get the paths to be rewritten. I have copied some examples directly from How to handle relative urls correctly with a reverse proxy without success.
I am trying to map https://dev.ourdomain.com/proxmox to https://10.2.7.101:8006.
ProxyPass /proxmox/ https://10.2.7.101:8006/
ProxyPassReverse /proxmox/ https://10.2.7.101:8006/
ProxyHTMLURLMap https://10.2.7.101:8006 /proxmox/
<Location /proxmox/>
ProxyPassReverse /
SetOutputFilter proxy-html
ProxyHTMLURLMap https://10.2.7.101:8006 /proxmox/
ProxyHTMLURLMap / /proxmox/
ProxyHTMLURLMap /proxmox/ /proxmox/
RequestHeader unset Accept-Encoding
</Location>
Can someone point out my (likely obvious) error?
Thank you in advance
Solution 1:
The answer ended up being a little more complicated than originally anticipated. After some more digging, and coming across a few different posts with pieces of the answer, especially https://serverfault.com/a/421452/262262, and came up with the following solution, as the conf file is no longer included in Apache 2.4.
cd /etc/apache2/mods-available/
wget "http://apache.webthing.com/svn/apache/filters/proxy_html/proxy_html.conf"
ln -s /etc/apache2/mods-available/proxy_html.conf /etc/apache2/mods-enabled/
service apache2 restart
With that, my current (and previous) configurations worked correctly.