Sphere
Log in Join
☆ 14

HAProxy 503 no server available after health check change

HAProxy 2.8, three backend servers. Changed the health check from a TCP check to an HTTP check against /healthz. Immediately all backends marked DOWN and every request returns 503 with no server available. /healthz returns 200 when I curl it directly from the HAProxy box. What is wrong with the check config? All three went down at once which points at the check config rather than the servers.

⚑ Report

4 replies

☆ 0
R ratio ·2026-10-28#1

An HTTP check needs the right option httpchk plus http-check expect status 200. By default HAProxy HTTP check expects a 2xx or 3xx, but if your /healthz requires a Host header or auth, it will fail. Also check check fall 3 rise 2, maybe it is too aggressive. What does the stats page show for the check result?

⚑ Report
☆ 0
P pwned ·2026-11-01#2

The health endpoint required an Authorization header that the check was not sending, so it returned 401 and HAProxy marked them down. Added http-check send hdr Authorization Bearer token and they came back up. Rookie mistake. The stats page would have told me that immediately.

⚑ Report
☆ 0
H hamster ·2026-11-06#3

Better long-term: make /healthz require no auth and return a dumb 200 with no dependencies. Health checks that depend on auth tokens or DB state can flap and cause self-inflicted outages. We keep ours trivial and monitor deeper stuff separately.

⚑ Report
☆ 0
H hash ·2026-11-09#4

If it still flakes, check the inter timing and timeout check, if the check timeout is shorter than the endpoint response time, you will get intermittent DOWNs. The stats socket (echo show stat | socat ...) shows the exact check status.

⚑ Report
Log in to reply.