0

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

chaosaffe
  • 111
  • 5
  • Why not use a local dns name ? then set it as virtual host with just `ProxyPass / https://10.2.7.101:8006/ ProxyPassReverse / https://10.2.7.101:8006/` and it will works – Froggiz Nov 27 '15 at 18:22
  • The problem isn't the IP, that routes just fine. It needs to be a path on the existing A record, as that is what we have the certificate for. Also, it needs to be externally routable. – chaosaffe Nov 27 '15 at 22:24
  • so it will accessible from url like www.domain.com ? – Froggiz Nov 27 '15 at 22:25
  • Please see the desired mapping above (https://dev.ourdomain.com/proxmox). It appears that this is a known issue with Debian's Apache2 package (the proxy_html.conf file is missing) causing any mappings to fail, which is the behavior I am experiencing – chaosaffe Nov 27 '15 at 22:28
  • Yup, i tried to remap url without success, that why i tried to give you a workthrough. So i pass on it, good luck ! – Froggiz Nov 27 '15 at 22:31
  • Could you post an answer with the full configuration ? i will try it tomorow, thanks – Froggiz Nov 27 '15 at 23:01

1 Answers1

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.

chaosaffe
  • 111
  • 5