Troubleshooting · 4 min read

F5 HTTP Health Monitor Expected Codes Mismatch

F5 BIG-IP pool members suddenly marking down despite the backend servers being healthy is a frustrating operational issue. Often the root cause is an HTTP health monitor configured with expected codes that do not match the actual HTTP responses from pool members. This mismatch silently fails health checks, causing unnecessary traffic loss and alerting fatigue. Understanding how F5 evaluates HTTP status codes and how to align monitor expectations with real-world application behavior is essential for reliable load balancing.

How F5 HTTP Health Monitors Evaluate Status Codes

F5 BIG-IP HTTP health monitors send HTTP requests to pool members and inspect the response status code. By default, the monitor expects a 200 OK response. The monitor marks a pool member as up only if the received status code matches one of the configured expected codes. If the response code does not match, the health check fails and the pool member is marked down after the configured number of consecutive failures.

The expected codes setting is a comma-separated list of HTTP status codes that the monitor will accept as healthy. Common configurations include 200, 201-299, or 200,201,202. The issue arises when the application returns a different code than what the monitor expects, such as 301 redirects, 302 found responses, or 503 service unavailable during graceful shutdown.

Common Scenarios That Cause Mismatches

Diagnosing the Problem

Start by testing the health check endpoint directly from the BIG-IP system or a client on the same network. Use curl or wget to send an HTTP request to the pool member using the exact URI configured in the monitor. Note the status code returned.

curl -v http://10.0.1.50:80/health

Expected output:
< HTTP/1.1 200 OK
or
< HTTP/1.1 301 Moved Permanently

Next, navigate to the BIG-IP web interface and check the pool member status. Click on the pool, then view the member details. The status icon and hover text will indicate if the member is marked down due to health check failure. In the monitor configuration, verify the expected codes setting matches the actual response.

Enable debug logging on the health monitor by accessing the pool member's detailed view and looking for any error messages. You can also use the tmsh command-line interface to query monitor statistics and see the last received response code.

Fixing the Mismatch

Once you have identified the actual status code returned by the pool member, update the monitor's expected codes to include that code. In the BIG-IP web interface, navigate to Local Traffic -> Monitors -> HTTP, select the monitor in use, and edit the Expected HTTP Response Codes field.

Example configurations:

For 200 OK only:
200

For 200-299 range (all 2xx codes):
200-299

For multiple specific codes:
200,201,202

For 200 or 301 redirect:
200,301

After updating the expected codes, the pool members should return to an up state within the monitor interval plus the time-until-up setting. Verify the change by checking pool member status again and confirming traffic is flowing to the backends.

Best practice is to use a dedicated health check endpoint on your application that always returns 200 OK and indicates true application health. This avoids coupling the load balancer monitor to application-level redirect logic or temporary status codes. If the application must return non-2xx codes, ensure the monitor configuration explicitly includes those codes.

F5 Health Monitor Builder
Generate correct HTTP monitor configurations with proper expected codes for your pool members.
Open →
Every Elematron tool is free for everyone — no account, no limits.
Browse free tools →
Free tools for this
More from the blog
FortiGate Model Selection: Throughput and CPU MatchingRead →F5 Health Monitor Interval and Timeout TuningRead →