I was wondering if there is a way with HAProxy to re-send a failed request to another server if the original server is down.
We run a REST API on multiple servers behind multiple HAProxy instances.
There is no balance affinity, balance is done purely on round-robin
.
To upgrade one server we can just restart it and due to health checks HAProxy will usually not send any data to this server.
BUT: If the server goes down between two health checks and HAProxy forwards a HTTP request to that server without knowing yet that it's down - that request fails (obviously).
Is there a way to configure HAProxy in such a way that it will notice that the connection went down and retry on another server?
Or at least make HAProxy mark that server as unhealthy directly so we only loose one request and not multiple ones during the transition.
HAProxy is running inside a docker container and the servers are also docker containers.