HTTP Status Codes / 5xx HTTP Status Codes

5xx HTTP Status Codes

5xx status codes are server error responses.

This is an educational guide. The pages linked here are documentation pages served as 200 OK, even when the HTTP status code being explained is an error response.

What 5xx means

Server error responses mean the request may be valid, but the server, gateway, or upstream dependency failed while trying to handle it.

Where 5xx responses appear

Implementation notes

Compare similar 5xx codes

500 vs 502 vs 503 vs 504 Server Errors

All four are server-side failures, but they point to different layers of the system.

CodeWhere to look firstMeaning
500Application logsThe origin server hit an unexpected error.
502Proxy and upstream logsA gateway received an invalid upstream response.
503Capacity and maintenance stateThe service is temporarily unavailable.
504Timeouts between proxy and upstreamA gateway waited too long for the upstream response.

Rules for every 5xx response

What RFC 9110 says about every 5xx response, quoted from the RFC.

The same rule is in the response obligations table and its JSON.

For an API, an RFC 9457 Problem Details body is one standard way to send that explanation.

All 5xx status codes

CodeNameMeaning
500Internal Server ErrorThe server encountered an unexpected condition that prevented it from fulfilling the request.
501Not ImplementedThe server either does not recognize the request method, or it lacks the ability to fulfill the request. Usually this implies future availability (e.g., a new feature of a web-service API).
502Bad GatewayThe server, while acting as a gateway or proxy, received an invalid response from an inbound server it accessed while trying to fulfill the request.
503Service UnavailableThe server is currently unable to handle the request because of a temporary overload or scheduled maintenance.
504Gateway TimeoutThe server, while acting as a gateway or proxy, did not receive a timely response from an upstream server it needed to complete the request.
505HTTP Version Not SupportedThe server does not support the HTTP protocol version used in the request.
506Variant Also NegotiatesTransparent content negotiation for the request results in a circular reference.
507Insufficient StorageThe server is unable to store the representation needed to complete the request.
508Loop DetectedThe server detected an infinite loop while processing the request (sent instead of 208 Already Reported).
509Bandwidth Limit ExceededThe server has exceeded the bandwidth specified by the server administrator; this is often used by shared hosting providers to limit the bandwidth of customers.
510Not ExtendedFurther extensions to the request are required for the server to fulfill it.
511Network Authentication RequiredThe client needs to authenticate to gain network access. Intended for use by intercepting proxies used to control access to the network (e.g., "captive portals" used to require agreement to Terms of Service before granting full Internet access via a Wi-Fi hotspot).
529Site is overloadedUsed by Qualys in the SSLLabs server testing API to signal that the site can't process the request.
530Site is frozenUsed by the Pantheon web platform to indicate a site that has been frozen due to inactivity.
598Network read timeout errorUsed by some HTTP proxies to signal a network read timeout behind the proxy to a client in front of the proxy.
599Network Connect Timeout ErrorAn error used by some HTTP proxies to signal a network connect timeout behind the proxy to a client in front of the proxy.

HTTP status code lookup
REST API status code chooser
cURL command generator
By Ping Now, a website/API/service uptime monitor
Data from Wikipedia