Hello,

I'm trying to achieve the following scenario using Apache 2.2:

- http://localhost/aaa/bbb?a=b must be proxied to http://<BalancerMember>:1234/aaa/bbb?a=b (where <BalanceMember> is either jack or jill) - http://localhost/aaa/bbb?b=c must be proxied to http://<BalancerMember>:1234/aaa/bbb?b=c - http://localhost/aaa must be proxied to http://<BalancerMember>:8080/aaa - http://localhost/aaa/ must be proxied to http://<BalancerMember>:8080/aaa/ - http://localhost/aaa/ccc must be proxied to http://<BalancerMember>:8080/aaa/ccc

Assume the following httpd.conf snippet on localhost:

   <VirtualHost _default_>
       DocumentRoot /usr/local/apache2/htdocs
       ServerName jack
       ErrorLog logs/error_log
       TransferLog logs/access_log

       <IfModule mod_proxy.c>
           ProxyPass /aaa/bbb balancer://balancer1
           ProxyPass /aaa balancer://balancer2

           <Proxy balancer://balancer1>
               BalancerMember http://jack:1234/aaa/bbb
               BalancerMember http://jill:1234/aaa/bbb
           </Proxy>

           <Proxy balancer://balancer2>
               BalancerMember http://jack:8080/aaa
               BalancerMember http://jill:8080/aaa
           </Proxy>
       </IfModule>
   </VirtualHost>

When I try this I end up with the following undesired result:

- http://localhost/aaa/bbb?a=b proxies to http://<BalancerMember>:1234/aaa/bbb/?a=b - http://localhost/aaa/bbb?b=c proxies to http://<BalancerMember>:1234/aaa/bbb/?b=c

Please note the added / in front of the ?

How can I fix this?

I initially used Apache 2.0 but that version seems to lack good load-balancing and failover features, if I'm not mistaken. There were a few things mentioned in the Apache2 Bible regarding load-balancing, for instance using a DNS server to load-balance. However, these options didn't seem feasible. That's why we switched to Apacha 2.2.

Just as some additional information, this was how I configured Apache 2.0 when we didn't use load-balancing and failover:

   <IfModule mod_proxy.c>
       ProxyRequests Off

       <Proxy *>
           Order deny,allow
           Allow from all
       </Proxy>

       ProxyPass /aaa/bbb http://localhost:1234/aaa/bbb
       ProxyPassReverse /aaa/bbb http://localhost:1234/aaa/bbb
       ProxyPass /aaa http://localhost:8080/aaa
       ProxyPassReverse /aaa http://localhost:8080/aaa
   </IfModule>

This seemed to have the desired result:

- http://localhost/aaa/bbb?a=b proxies to http://localhost:1234/aaa/bbb/?a=b - http://localhost/aaa/bbb?b=c proxies to http://localhost:1234/aaa/bbb/?b=c

Regards,
Jack...



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
  "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to