Balncing in a specific way

Hello. I am trying to reslov the following task but i canot. please help me. I have 2 servers of my service: main and slave. My customers get an access to the service via Cloudflare. There are rare cases when main goes down and not availanble, I have a /ping GET function to check this status. In case the main servers is not responding to more than 10 seconds, I want cloudflare to change the server to my slave. I found an option when Cloudflare can randomly balance trafic, but I don’t need it. Can you help me?

2 posts were merged into an existing topic: Balancing traffic a psecific way