I have a bunch of identical apps that are configured to listen on the same url path. For example:
http://server:80/app
I would like to setup an Apache reverse proxy to provide namespacing to the URLs so each app will not have conflicting URLs:
http://proxy:80/namespace1/app -> http://destserver1:80/app
http://proxy:80/namespace2/app -> http://destserver2:80/app
I played around with ProxyPass, ReverseProxyPass, and ProxyPreserveHost options to no avail. Specifically when the apps would send a redirect request the redirects would not preserve the namespace.
What would a sample httpd config file look like to apply a namespacing function while acting as a reverse proxy?
This is my sample config (for a single server) that is not working with redirects:
Listen 80
<VirtualHost *:80>
ServerName 127.0.0.1:80
<Location /namespace/app/>
ProxyPreserveHost on
ProxyPass http://destserver:80/app/
ProxyPassReverse http://destserver:80/app/
</Location>
#ErrorLog logs/test-log
</VirtualHost>
The problem is that http://proxy:80/namespace/app/path sends a redirect which becomes http://proxy:80/app/path/redirect/path (404) which is missing the namespace.
Thanks