httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <>
Subject Re: Bug in rewrite or proxy?
Date Sat, 08 Apr 2006 19:34:07 GMT

On 04/08/2006 09:40 AM, Bjørn Stabell wrote:

> In Apache 2.2.1 (the release candidate) mod_proxy_balancer and 
> mod_deflate seems ok, but either mod_proxy or mod_rewrite is breaking 
> badly.  Here's what the trimmed down config file looks like (it still 
> exhibits the same problem):
>     Listen
>     <VirtualHost>
>             ServerName
>             RewriteEngine On
>             RewriteRule ^/external/(.*)       
>$1 [P]
>             RewriteRule  ^/(.*)  $1 [P]
>     </VirtualHost>
> What happens is:
> 1. Restart Apache
> 2. Access
> -> is proxied to as expected
> 3. Access (and all subsequent requests)
> -> is still proxied to, although rewrite_log shows it 
> matches the /external rule

As I investigated this one thing came up to my mind:

If you use the proxy in the way described above the '*' worker will be used which
will be created automatically. Having the generic '*' available is a good thing, BUT
this is not optimal from the performance point of view in these situations as the '*'
worker has changing remote addresses and thus does not benefit from keepalives to the
backend as much as it could. OTOH ProxyPass which creates explicit workers does not
know regular expressions and is not well suited for more complex situations. The only
other way to create a worker for a defined target is to add a BalancerMember to a
balanced backend.
So what about adding a directive called ProxyAddWorker that just defines a worker?
This would enable the following configuration:


     ProxyAddWorker max=10
     ProxyAddWorker max=20


             RewriteEngine On
            RewriteRule ^/external/(.*)$1 [P]
             RewriteRule  ^/(.*)  $1 [P]

Of course ProxyAddWorker should not be mandatory. If the worker is not defined
the '*' worker should still be used.



View raw message