LB Failover for multiple sites hosted on same origin server


We are setting up 6 websites on two origin servers configured as failover of each other. Have added both origin server (server1 & server2) to two Pools (pool1 and pool2). We have configured 6 load balancers one for each site with primary pool as pool1 and failover pool as pool2.

Our problem statement is that since there is only on monitor configured that monitors the HTTP/S response, I am not able to do automatic failover for all the sites except the main site. Even when I shutdown 5 sites the pool1 is always healthy. Only when I shutdown the 1st website, the pool1 becomes unhealthy and failover happens.

I don’t want to add more origins i.e. to configure two separate origins with Host Headers for each website.

Please suggest workaround.


To further elaborate the topic
a) We have only two origins servers (server1 and server2) but multiple sites (6 sites) hosted on each origin
b) We have configured two pools (pool1 and pool2) , each pool having one origin server,
c) We have configured 6 load balancers, one for each website, with primary pools as pool1 and failover pool as pool2,
d) We need the Load Balancer configured for each website to respond based on the Health status of respective website.
e) we need separate Health Monitoring for each site and LB to failover based on the health monitor

You can add the Health Check (Overview · Cloudflare Health Checks docs) for each domain.

As per cloudflare only option is to purchase more Origin server and create separate pools. We did that now we have 4 origin server (for 2 physical IPs), 4 pools for 2 website hosted on same origin servers.

So config is like this
IP1 = origin1 = pool1 = site1
IP2 = origin2 = pool2 = site1
IP1 = origin3 = pool3 = site2
IP2 = origin4 = pool4 = site2

For us when ever we shutdown any one of the sites - site1 or site2 on primary (IP1) instead of traffic shifting to secondary (IP2), the site which is down gets redirected to the site which is up. Only when we shutdown both sites, the redirection to secondary (IP2) works.

We tested by bypassing the cloudflare (LB & Prosy) and directly pointing to IP1 / IP2 the respective sites works perfectly fine.