Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Beware the trailing slash in mod_proxy_balancer (part 2)

It is a little tricky to prevent mod_proxy_balancer from adding a trailing slash.

This will redirect /MyService?wsdl to http://example.com:X0000/MyService/

    ProxyPass /MyService balancer://playlist_service_balancer

    <Proxy balancer://playlist_service_balancer>
      BalancerMember http://example.com:10000/MyService
      BalancerMember http://example.com:20000/MyService

      ProxySet lbmethod=byrequests
    </Proxy>


This will redirect /MyService?wsdl to http://example.com:X0000/MyService?wsdl
  ProxyPass /MyService balancer://playlist_service_balancer/MyService

  <Proxy balancer://playlist_service_balancer>
    BalancerMember http://example.com:10000/
    BalancerMember http://example.com:20000/

    ProxySet lbmethod=byrequests
  </Proxy>


see https://issues.apache.org/bugzilla/show_bug.cgi?id=39203

Beware the trailing slash in Proxy balancer

This is correct

ProxyPass / balancer://app                                                                                                                                                                                                         
<Proxy balancer://app>                                                                                                                                                                                                             
BalancerMember http://10.0.0.166:8181                                                                                                                                                                                                  
BalancerMember http://10.0.0.166:8182                                                                                                                                                                                                  
BalancerMember http://10.0.0.166:8183                                                                                                                                                                                                  
BalancerMember http://10.0.0.166:8184                                                                                                                                                                                                  
BalancerMember http://10.0.0.166:8185                                                                                                                                                                                                  
BalancerMember http://10.0.0.166:8186                                                                                                                                                                                                  
BalancerMember http://10.0.0.166:8187                                                                                                                                                                                                  
BalancerMember http://10.0.0.166:8188                                                                                                                                                                                                  
BalancerMember http://10.0.0.166:8189                                                                                                                                                                                                  
BalancerMember http://10.0.0.166:8190                                                                                                                                                                                                  
</Proxy>  


This is not

ProxyPass / balancer://app                                                                                                                                                                                                         
<Proxy balancer://app>                                                                                                                                                                                                             
BalancerMember http://10.0.0.166:8181/                                                                                                                                                                                                  
BalancerMember http://10.0.0.166:8182/                                                                                                                                                                                                  
BalancerMember http://10.0.0.166:8183/                                                                                                                                                                                                
BalancerMember http://10.0.0.166:8184/                                                                                                                                                                                                  
BalancerMember http://10.0.0.166:8185/                                                                                                                                                                                                  
BalancerMember http://10.0.0.166:8186/                                                                                                                                                                                                  
BalancerMember http://10.0.0.166:8187/                                                                                                                                                                                                  
BalancerMember http://10.0.0.166:8188/                                                                                                                                                                                                  
BalancerMember http://10.0.0.166:8189/                                                                                                                                                                                                  
BalancerMember http://10.0.0.166:8190/                                                                                                                                                                                                  
</Proxy>  


This is also not correct

ProxyPass / balancer://app/                                                                                                                                                                                                        
<Proxy balancer://app/>                                                                                                                                                                                                            
BalancerMember http://10.0.0.166:8181/                                                                                                                                                                                                 
BalancerMember http://10.0.0.166:8182/                                                                                                                                                                                                 
BalancerMember http://10.0.0.166:8183/                                                                                                                                                                                                 
BalancerMember http://10.0.0.166:8184/                                                                                                                                                                                                 
BalancerMember http://10.0.0.166:8185/                                                                                                                                                                                                 
</Proxy>