We use a combination of healthchecks and “backup” config to redirect requests to a “service unavailable” site if the main service fails and haproxy has marked all the backend servers as down.
For requests that match certain conditions, we’d like to be able to “override” the down status, and proxy certain traffic to the main servers rather than the failover one.
Example conditions would be requests with a “secret” override URL param (e.g. ?override-key=foo") that developers could use to check the backend services before bringing them back up, or e.g. a specific URL (e.g. “/healthcheck”) our monitoring uses. Currently, when a service is down, the request to “/healthcheck” is answered by the failover service, which means our monitoring doesn’t mark the service as down.
I’ve read in the docs about “force-persist” options, but these require you to already have a session cookie for a specific backend. Is there a way to use “force-persist” but without a cookie for requests that match the above conditions/ACLs, and have haproxy ignore the “down” status of the backend servers?