tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: mod_proxy_ajp with multiple ajp ports
Date Fri, 14 Jul 2006 20:31:15 GMT

Thanks for the response.

> I've seen some talk on dev@httpd about implementing support for 
> regexps in mod_proxy, but I don't think anything has happened yet.

It doesn't appear to be a question of regular expressions, since the
<Location> element can use regular expressions. The problem is that,
when those regular expressions are used, it clobbers the URL for
proxying, and the proxy attempts to use the wrong source URL (or something).

> What you want is something like:
>   RewriteRule /my/path/.*\.whatever\.else 
> ajp://localhost:8285/my/path/$1.whatever.else [P]

For whatever reason, this does not work on its own. I figured that I
could do something like this:

RewriteRule /myApp/some/special.url \
            ajp://localhost:8285/myApp/special.url [P]
RewriteRule /myApp/(.*) \
            ajp://localhost:8185/myApp/$1 [P]

...but that's not enough. You have to mix both RewriteRule /and/
ProxyPass to achieve the desired result:

RewriteRule /myApp/some/special.url \
            ajp://localhost:8285/myApp/special.url [P]
ProxyPass /myApp ajp://localhost:8185/myApp

My best guess is that Apache requires the ProxyPass directive in there
so that my virtual host gets configured to use mox_proxy /at all/. I'd
imagine that I could have as many RewriteRules as I needed, as long as
that one ProxyPass directive is in there.

Perhaps someone with a better understanding can tell me what's really
going on.

For now, I'm happy since it appears to work exactly as desired.

Thanks a lot for the help!


View raw message