httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Cicimov <icici...@gmail.com>
Subject Re: [users@httpd] mod_proxy: ProxyPreserveHost omits start of proxied path
Date Fri, 30 Mar 2012 09:01:21 GMT
Have you actually read the mod_proxy documentation or you are just working
with some example you found somewhere? If you read it you will find that
you can use ! in the ProxyPass to exclude a path from the proxy.
 On Mar 29, 2012 11:39 PM, "Ron Van den Branden" <ron.vandenbranden@kantl.be>
wrote:

>  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/ <http://localhost:8080/>
>   ProxyPassReverse    */*apps/    http://localhost:8082/ <http://localhost:8080/>
>   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/> <http://localhost:8082/my_app/>, and this
> request is internally redirected to
> <http://localhost:8082/my_app/index.htm><http://localhost:8082/my_app/index.htm>,
> a request for  <http://mydomain/apps/my_app/><http://mydomain/apps/my_app/>is
correctly redirected to
> <http://mydomain/apps/my_app/index.htm><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/> <http://mydomain/apps/my_app/> now ends up
> at <http://mydomain/my_app/index.htm> <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
>

Mime
View raw message