The ones that matter most
200 means the request succeeded. 301 and 308 are permanent redirects; 302 and 307 are temporary. 404 means nothing was found at that URL, 410 that it has gone for good. 500 means the server failed, 502 and 504 that a proxy could not reach the application in time, and 503 that the service is temporarily unavailable, which is the right code for a planned maintenance page.
How an uptime check reads them
A check normally counts 2xx as up and 5xx as down. The 4xx codes need a decision per URL: a 401 or 403 on a page that should be public, or a 404 on the home page, is an incident, while a 404 on an address that was never meant to exist is not. A 429 says the server is limiting the requester, which is information about the check, not about the site. Write down which codes count as up for each important URL instead of accepting “anything below 400”.
The limit of a status code
It describes the protocol exchange, not the page. A server can answer 200 with an empty page, an error message or the wrong site. That is why uptime checks should also verify content.
An example
curl -s -o /dev/null -w "%{http_code} %{redirect_url}\n" http://example.com/ prints the status of the first response and where it redirects, for instance 301 https://example.com/. A check that follows redirects should record both the first status and the final one: a 200 after four hops tells a different story from a 200 at the first request, and a 200 whose page says “not found” is a soft 404.
What to check
That each important URL returns the status you expect, that error pages return error codes and that maintenance pages return 503.
Sources
Read on . Standards and vendor pages change; confirm the current text before you rely on it.
- RFC 9110, HTTP Semantics (www.rfc-editor.org)