Search code examples
apachemod-proxy

Apache mod-proxy load balancer maintenance


I have mod-proxy and mod-proxy-balancer setup as a load balancing reverse proxy. Something like this:

<Proxy balancer://example>
    BalancerMember http://hostname:8000 keepalive=on
    BalancerMember http://hostname:8001 keepalive=on
</Proxy>

ProxyPass / balancer://example/
ProxyPassReverse / balancer://example/
ProxyPreserveHost on
ProxyRequests Off

Is there a simple way to set this up to show a static maintenance page when all members of the balancer group are down? I've done that with a hardware load balancer previously and it was very useful.


Solution

  • Maybe you can use a hot standby. The example below is from the ProxyPass Directive section where it says "Setting up a hot-standby, that will only be used if no other members are available"

    ProxyPass / balancer://hotcluster/
    <Proxy balancer://hotcluster>
    BalancerMember http://1.2.3.4:8009 loadfactor=1
    BalancerMember http://1.2.3.5:8009 loadfactor=2
    # The below is the hot standby
    BalancerMember http://1.2.3.6:8009 status=+H
    ProxySet lbmethod=bytraffic </Proxy>