What HTTP 503 means
The server is up but can’t serve right now: it is overloaded, in maintenance mode, or has no healthy backends. Unlike 500, the condition is expected to be temporary. Include Retry-After so clients and crawlers know when to come back. Google treats short periods of 503 as temporary and doesn’t drop pages.
How to fix a 503 error
-
Kubernetes ingresses return 503 when a Service has no ready pods: check
kubectl get endpoints. -
Use 503 with
Retry-Afterfor planned maintenance pages, never 200 or 404. - Autoscaling lag and exhausted worker pools cause 503s under traffic spikes.
Retrying
Yes, after the delay in the Retry-After header if present, otherwise with exponential backoff.
Example response
HTTP/1.1 503 Service Unavailable
Date: Wed, 21 Oct 2026 10:30:00 GMT
Retry-After: 120
Content-Type: application/json
How to return 503
res.status(503).json({ error: 'Service Unavailable' });
from fastapi import HTTPException
raise HTTPException(status_code=503, detail="Service Unavailable")
http.Error(w, http.StatusText(http.StatusServiceUnavailable), http.StatusServiceUnavailable)
location /private/ {
return 503;
}
Related status codes
- 502 Bad Gateway : A proxy or gateway got an invalid response from the upstream server.
- 504 Gateway Timeout : A proxy or gateway didn’t get a response from the upstream server in time.
- 429 Too Many Requests : The client has sent too many requests in a given time (rate limiting).
Other 5xx status codes
500 Internal Server Error · 501 Not Implemented · 502 Bad Gateway · 504 Gateway Timeout · 505 HTTP Version Not Supported · 507 Insufficient Storage · 508 Loop Detected · 511 Network Authentication Required · 520 Web Server Returned an Unknown Error · 521 Web Server Is Down · 522 Connection Timed Out · 523 Origin Is Unreachable · 524 A Timeout Occurred · 525 SSL Handshake Failed · 526 Invalid SSL Certificate
See the full list of HTTP status codes.
Sources
Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.
Frequently asked questions
What does HTTP 503 Service Unavailable mean?
HTTP 503 Service Unavailable means the server is temporarily unable to handle requests, usually overload or maintenance. The server is up but can’t serve right now: it is overloaded, in maintenance mode, or has no healthy backends. Unlike 500, the condition is expected to be temporary. Include Retry-After so clients and crawlers know when to come back. Google treats short periods of 503 as temporary and doesn’t drop pages.
How do I fix HTTP 503?
Kubernetes ingresses return 503 when a Service has no ready pods: check kubectl get endpoints. Use 503 with Retry-After for planned maintenance pages, never 200 or 404. Autoscaling lag and exhausted worker pools cause 503s under traffic spikes.