0

I am trying to achieve this:

subdomain.mydomain.com/customerA -> internalserver1/application/ subdomain.mydomain.com/customerB -> internalserver2/application/

This broght me to the login page of the application (on mobile only and with no images):

ProxyPass /customerA http://internalserver1/application
ProxyPassReverse /customerA http://internalserver1/application
ProxyPass /customerB http://internalserver2/application
ProxyPassReverse /customerB http://internalserver2/application

Reading here made me add this:

ProxyPass /application http://internalserver1/application
ProxyPassReverse /application http://internalserver1/application

This made images available, but I don't see how to apply this to multiple servers.

I think I need to use mod_rewrite, but I don't get how. Also, I don't get why the above only works on mobile and not on desktop.

Thanks!

gvnn
  • 3
  • 1

1 Answers1

1

mod_rewrite won't do you any good.

The best option would be to configure your backend servers to serve the HTML with the correct base URL (/customerA/ instead of /application/).

If this is not possible you can use ProxyHTMLURLMap from mod_proxy_html to rewrite the HTML before it is served.

This will however add latency to your requests and load to your proxy server.

Gerald Schneider
  • 23,274
  • 8
  • 57
  • 89
  • Thanks Gerald, unfortunately I cannot change the application name. I tried to use 'ProxyHTMLURLMap' without success, so far. I forgot to mention the application is based on Tomcat, I am now exploring [this](https://tomcat.apache.org/tomcat-8.0-doc/proxy-howto.html) – gvnn Sep 25 '19 at 16:29
  • The key is to set the correct Context path in the tomcat server config. – Gerald Schneider Sep 25 '19 at 18:10
  • Would it make more sense to use `mod_jk` instead of `mod_proxy`? It is both promising and confusing. – gvnn Sep 27 '19 at 16:12