Event on HTTP/HTTPS failures

Hi,

i’m trying to get my CCR1* VRRP Cluster to detect TCP stream failures (or http/https failures) from Wan to an internal webserver, and start an event if this is the case.
To be more precise, it’s a matter of redundancy and failover.
The scenario: let’s say https requests are flowing from WAN to the primary webserver, the webserver (Apache or whatever) crashes, and the NIC of the OS is still reachable (which is why a simple ICMP Netwatch will not do the trick).
If such failure happens, i would like to change the destination from master webserver to the standby webserver (and vice versa).

All i have found so far, is a promising action “route” in mangle rules, but TCP flags as a condition will probable not help in this scenario.
Can this be done? Is there are way to trigger an event based on a connection?

To be honest, my first idea was to do this with Keepalived on both webservers, but i’ve been asked to find a way to keep the redundancy/failover logic on the Mikrotik instead of the servers.

best regards, Bliz

*edit, another idea that came to mind is using the fetch tool within a script?