You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Guillaume Fraysse <gf...@gmail.com> on 2009/08/25 17:05:30 UTC

[users@httpd] mod_proxy : ProxyPassReverse and regex ?

Hello to the list,

I'm trying to put up some vodoo Reverse Proxy Configuration on 2.2.11
(64bits, linux) apache build.
What I'm trying to achieve is that all URL such as
https://my.domain.com/alice/bob/xxx are redirected to intranet URLs such as
http://alice.intranet/alice/bob/xxx

I'm using regex, mod_rewrite and mod_proxy for that and it's working just
fine but I'm facing a problem when one of the web application behind my
reverse proxy use a "Location:" header. In this case the user gets an
intranet URL  which he can't access. ProxyPassReverse semmes to be the
adequate answer but doens't seem to support regex

Sample :
I currently have :
RewriteCond %{REQUEST_URI} ^/(.*)/bob.*
RewriteRule ^/(.*)/bob(.*) http://$1.intranet/$1/bob$2 [P,L] and this works
fine

it seems natural to have a rule such as :
ProxyPassReverse /(.*)/bob/ http://$1.intranet/$1/bob

but this doesn't seem to be possible with ProxyPassReverse.

So I have a few questions :
- are regex supported in ProxyPassReverse ?
- is there a workaround ? I'd like to avoid hard-coded ProxyPassReverse
rules in my apache configuration.

Best regards,
Guillaume