503 Service Unavailable
The server is currently unable to handle the request due to a temporary overloading or maintenance of the server.
❓ Why does this happen?
Server undergoing maintenance, traffic spike exceeding server capacity, or serverless cold boot failure.
✅ How to fix it
Scale server capacity, verify server health checks, and retry after maintenance completes.
Return or handle 503 in your stack
// app/api/resource/route.ts
export function GET() {
return Response.json(
{ error: "Service Unavailable", status: 503 },
{
status: 503,
headers: { "Retry-After": "60" }
}
);
}Live 503 mock endpoint
Point your app, tests, or retry logic at this free public URL to reproduce a real 503 response (CORS enabled, optional ?delay=ms up to 5000).
https://castov.com/api/mock/503503 vs similar status codes
500 is an unexpected bug or crash. 503 is a deliberate, temporary 'not now' (maintenance or overload) and should include Retry-After.
502 comes from a proxy that got a bad answer from upstream. 503 is the service itself (or the proxy) saying it is temporarily unavailable.
429 targets one client that exceeded its rate limit. 503 means the whole service is unavailable for everyone.
Frequently Asked Questions
What does HTTP Status 503 mean?
Why am I getting a 503 status code?
How do I fix a 503 Service Unavailable error?
What is the difference between 503 Service Unavailable and 500 Internal Server Error?
What is the difference between 503 Service Unavailable and 502 Bad Gateway?
What is the difference between 503 Service Unavailable and 429 Too Many Requests?
How can I test how my app handles a 503 response?
Other 5xx status codes
Browse the full HTTP status codes directory or troubleshoot terminal errors in the Error Fix Encyclopedia.