i have a setup with :
HAProxy acting as a layer 4 LB (just forwarding requests, passthrough, TCP mode for all frontend/backend) to multiple Apache frontends. Each of these apache frontends is sending the traffic to a tomcat backend where an application is running.
Now, if one of these tomcats/applications is crashed, the corresponding apache frontend reports an error 503 (which is normal), others are OK.
problem is : as HAProxy is just load balancing to each Apache randomly (based on source IP in my case), some users get the 503 errors (pointing to a tomcat not working), while others are working (pointing to a tomcat that is OK)
is there a way to detect that in any way ? (and ensure users are only redirected to a working frontend/backend)
i suppose i can't do anything on the HAproxy side as HAproxy is forwarding to the "Apache" backends (and reports them as healthy as port 443 is OK) and does not see the real backends (the tomcat servers). i suppose i have to do something on the apache frontends (such as "if there is a 503, stop apache" or something).
any idea on how to handle this ?
ps : let me know if you want to see the config