Skip to main content
HTTP/5xx (Server Error)

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/503

503 vs similar status codes

Frequently Asked Questions

What does HTTP Status 503 mean?
The server is currently unable to handle the request due to a temporary overloading or maintenance of the server.
Why am I getting a 503 status code?
Server undergoing maintenance, traffic spike exceeding server capacity, or serverless cold boot failure.
How do I fix a 503 Service Unavailable error?
Scale server capacity, verify server health checks, and retry after maintenance completes.
What is the difference between 503 Service Unavailable and 500 Internal Server Error?
500 is an unexpected bug or crash. 503 is a deliberate, temporary 'not now' (maintenance or overload) and should include Retry-After.
What is the difference between 503 Service Unavailable and 502 Bad Gateway?
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.
What is the difference between 503 Service Unavailable and 429 Too Many Requests?
429 targets one client that exceeded its rate limit. 503 means the whole service is unavailable for everyone.
How can I test how my app handles a 503 response?
Send a request to https://castov.com/api/mock/503 — it returns a real 503 Service Unavailable response with CORS enabled. Add ?delay=2000 to simulate a slow server.

Other 5xx status codes

Browse the full HTTP status codes directory or troubleshoot terminal errors in the Error Fix Encyclopedia.