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
- Application code throws an unexpected error.
- A reverse proxy or gateway cannot reach an upstream service.
- The service is overloaded, down for maintenance, or timing out.
- A server extension, negotiation step, or storage dependency fails.
Implementation notes
- Use 500 for unexpected application failures that do not have a more specific status.
- Use 502, 503, and 504 to distinguish bad upstream responses, temporary unavailability, and gateway timeouts.
- Log server-side details, but keep public error responses short and free of secrets.
All 5xx status codes
| Code | Name | Meaning |
|---|---|---|
| 500 | Internal Server Error | A generic error message, given when an unexpected condition was encountered and no more specific message is suitable. |
| 501 | Not Implemented | The 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). |
| 502 | Bad Gateway | The server was acting as a gateway or proxy and received an invalid response from the upstream server. |
| 503 | Service Unavailable | The server cannot handle the request (because it is overloaded or down for maintenance). Generally, this is a temporary state. |
| 504 | Gateway Timeout | The server was acting as a gateway or proxy and did not receive a timely response from the upstream server. |
| 505 | HTTP Version Not Supported | The server does not support the HTTP protocol version used in the request. |
| 506 | Variant Also Negotiates | Transparent content negotiation for the request results in a circular reference. |
| 507 | Insufficient Storage | The server is unable to store the representation needed to complete the request. |
| 508 | Loop Detected | The server detected an infinite loop while processing the request (sent instead of 208 Already Reported). |
| 509 | Bandwidth Limit Exceeded | The server has exceeded the bandwidth specified by the server administrator; this is often used by shared hosting providers to limit the bandwidth of customers. |
| 510 | Not Extended | Further extensions to the request are required for the server to fulfill it. |
| 511 | Network Authentication Required | The 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). |
| 529 | Site is overloaded | Used by Qualys in the SSLLabs server testing API to signal that the site can't process the request. |
| 530 | Site is frozen | Used by the Pantheon web platform to indicate a site that has been frozen due to inactivity. |
| 598 | Network read timeout error | Used by some HTTP proxies to signal a network read timeout behind the proxy to a client in front of the proxy. |
| 599 | Network Connect Timeout Error | An error used by some HTTP proxies to signal a network connect timeout behind the proxy to a client in front of the proxy. |