Score:0

Apache - ProxyPassReverse multiple entries with same host

cn flag

we have apache load balancing configuration like so:

<Proxy balancer://acluster>
BalancerMember ajp://10.10.10.1:8123 route=r1
BalancerMember ajp://10.10.10.2:8123 route=r2
</Proxy>
ProxyPass / balancer://acluster

#ProxyPassReverse / balancer://acluster
ProxyPassReverse / ajp://10.10.10.1:8123
ProxyPassReverse / ajp://10.10.10.2:8123

I am trying to find out, what is the purpose or effect of having those multiple ProxyPassReverse entries instead of using that line which was commented out. Thank you

Score:0
jp flag

TL;DR: Just use the ProxyPassReverse / balancer://acluster.

There is no purpose with those separate ProxyPassReverse lines as the Apache Module mod_proxy_balancer gives example configuration with ProxyPassReverse referencing the balancer://:

<Proxy "balancer://mycluster">
    BalancerMember "http://192.168.1.50:80"
    BalancerMember "http://192.168.1.51:80"
</Proxy>
ProxyPass        "/test" "balancer://mycluster"
ProxyPassReverse "/test" "balancer://mycluster"

The documentation for ProxyPassReverse Directive does not specify what would happen with multiple ProxyPassReverse directives. In the worst-case, requests for a balancer member might have the rewritten Host header of another balancer member. It depends on the configuration of the backend server whether this causes problems or not.

Also, if the current configuration with separate lines was valid, it would not be an easily manageable solution as it would require an additional update for the ProxyPassReverse configuration every time you add a BalancerMember.

Michal avatar
cn flag
Thank you, i was thinking that its maybe so the request made via reverseProxy do not go through the cluster. Its a strange one
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.