I worked on debugging the problem today of mixing mod_proxy and mod_rewrite together, and I had to use balancer://mycluster in the RewriteRule to stop getting the 404 error from Apache. I have two questions:
1) Is there any other way to get the rewritten URL to go through the balancer without adding balancer://mycluster to the RewriteRule ?
2) Is there a way to define all the parameters defined in ProxyPass (stickysession = JSESSIONID | jsessionid scolonpathdelim = On lbmethod = bytraffic nofailover = Off) either in <Proxy> or RewriteRule ? I am concerned about requests that match the new RewriteRule , will not load the balance in the same way as those that go through ProxyPass (e.g. /app1/something.do )?
Below are the relevant sections of httpd.conf. I am using Apache 2.2.
<Proxy balancer://mycluster> Order deny,allow Allow from all BalancerMember ajp://my.domain.com:8009 route=node1 BalancerMember ajp://my.domain.com:8009 route=node2 </Proxy> ProxyPass /app1 balancer://mycluster/app1 stickysession=JSESSIONID|jsessionid scolonpathdelim=On lbmethod=bytraffic nofailover=Off ProxyPassReverse /app1 ajp://my.domain.com:8009/app1
...
RewriteRule ^/static/cms/image/(.*)\.(.*) balancer://mycluster/app1/$1.$2 [P,L]
source share