Hi,

I am setting up a reverse proxy configuration that will proxy all requests starting with /apps/ to a Tomcat server running on a closed port. I have set up following configuration in httpd.conf:

  ProxyRequests off
  ProxyPass/apps/     http://localhost:8082/
  ProxyPassReverse/apps/http://localhost:8082/
  ProxyPassReverseCookiePath/apps/  /

This generally works, even for internal redirections inside the Tomcat apps I'm addressing. Suppose my Tomcat app is internally accessible at <http://localhost:8082/my_app/>, and this request is internally redirected to <http://localhost:8082/my_app/index.htm>, a request for <http://mydomain/apps/my_app/> is correctly redirected to <http://mydomain/apps/my_app/index.htm>.

Yet, there's a webstart application inside a Tomcat app that needs the *original* URL, instead of the proxied 'localhost:8082' URL. Hence, I tried by adding:

  ProxyPreserveHost     on

But this does not work 100%:
-internal redirects inside the Tomcat app omit the /apps/ part from the redirected URL. For example, a request for <http://mydomain/apps/my_app/> now ends up at <http://mydomain/my_app/index.htm>. -also (and probably related): the webstart application inside the Tomcat app doesn't preserve the /app/ part of the original request, and fails.

All does work perfectly, however, with ProxyPreserveHost switched on, when the entire URL space is proxied: "ProxyPass / http://localhost:8082/"; etc. But I explicitly want to limit the proxying to just one URL pattern, starting with '/apps/'. How can the '/apps/' part of the original request be passed on to the proxied URL (as apparently was the case with ProxyPreserveHost switched off)? (Note: proxying to http://localhost:8082/apps/ is not an option, as there is no physical /apps/ folder there).

I hope this sketches my problem. I have the feeling I'm almost there; any help much appreciated!

Ron

Reply via email to