httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: [users@httpd] convert from mod_jk to proxy_ajp
Date Thu, 01 Jan 2009 13:57:58 GMT
Eric Covener wrote:
> On Thu, Jan 1, 2009 at 7:47 AM, André Warnier <> wrote:
>> RewriteCond %{REQUEST_URI} !/servlet\.[^\.]+$
>> RewriteRule ^/xyz/(.*)$ /$1 [PT]
>> <LocationMatch "/servlet\.[^.]+$">
>>  ProxyPass ajp://localhost:8009
>> </LocationMatch>
>> File "/srv/www/star1/docs/xyz/" not found.
> Are there any other rewrites that actually apply to the servlet and
> don't use PT?  

Not in this case, no.

A matching RewriteRule w/o PT will prevent parts of
> mod_proxy from running (where it tags a request as being for the
> proxy, to be handled later)
> My usual suggestion/simplification is to use rewrite with the P flag
> whenever rewrite and proxy are required for the same context root. 

As mentioned in my post, I am new to this, and not quite clear yet about 
the interaction between mod_rewrite and mod_proxy. (*)

Another point a bit obscure to me is when using the <LocationMatch> 
section above, if the ProxyPass then really works as expected, taking 
the complete matching URI as argument 1.
Apparently the ProxyPass does not work, because Apache is trying to 
server the URI itself.  But if I try to add an URI first argument to 
ProxyPass, it signals an error in the arguments at startup of Apache.

> believe in 2.0.x it was less predictable because the Proxy could
> actually run first and prevent rewrite from happening at all.

The Apache version is 2.2.3 here, so it should not be a concern.

> If you're handy with a debugger, 
not at all

"proxy_trans" is the name of the
> function that can be "covered up".

(*) For example, could I spare the <LocationMatch> and ProxyPass 
entirely, and use a RewriteRule to forward this directy to the ajp port, 
a bit like :
RewriteRule ^/(xyz/.*/servlet\.[^\.]+)$ ajp://localhost:8009/$1 [PT]

I am not quite sure that I really want to do this, because the 
<LocationMatch> section is also handy to add other things, so let's say 
this is just curiosity at this point.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message