503 Service Unavailable: what it means and how to fix it
Kofi Agyem, Founder and CEO, CloudzyroPublished · 5 min read
On this page
A 503 Service Unavailable means the server can't handle requests right now, often overload or maintenance. What causes it and how to fix it for good.
1. The short answer
A 503 Service Unavailable error means the server is working but can't handle requests right now, usually because it's overloaded, in maintenance, or has no healthy app to pass the request to. It's meant to be temporary. As a visitor, wait a few minutes; as a site owner, find out which of those three it is.
RFC 9110 lets the server send a Retry-After header with a 503 to say when to come back.
2. What you'll see
"503 Service Unavailable", "Service Temporarily Unavailable", "The server is temporarily unable to service your request due to maintenance downtime or capacity problems" (Apache), WordPress's "Briefly unavailable for scheduled maintenance. Check back in a minute.", or a branded maintenance page.
3. Common causes
- Maintenance mode, switched on deliberately or left on by an interrupted update.
- Overload. A traffic spike, a bot crawling hard, or an attack uses up every worker.
- No healthy backend. A load balancer or proxy has no running app to send the request to, because it crashed or failed its health checks.
- The app is starting. Some platforms answer 503 while a service starts or scales up from zero.
- A rate limiter. nginx's
limit_reqandlimit_connanswer 503 by default when a client goes over. - Resource limits on shared hosting, when an account hits its share of processes or memory.
- A dependency is down, such as a database, and the app reports itself unavailable.
4. How to fix a 503 as a visitor
- Wait a few minutes, then refresh once.
- Check the site's status page or social accounts for planned maintenance.
- Try again later in the day if it's a busy moment, like a ticket sale.
- If it lasts, tell the site owner when and where you saw it.
5. How to fix a 503 on your own site
Work out which kind of 503 it is. The response's server: header and the page itself say which layer answered: your app, nginx, Apache, a load balancer or a CDN.
WordPress. If you see "Briefly unavailable for scheduled maintenance", delete the .maintenance file in the site's main folder (where wp-config.php is), then check that the update finished. Persistent 503s on busy WordPress sites are usually too many uncached, slow requests: add page caching and look for heavy plugins.
Apache and cPanel hosting. When Apache's proxy or PHP handler can't reach the backend, it answers 503 and logs something like AH01079: failed to make connection to backend. Check that PHP-FPM, or the app it proxies to, is running. A message about resource limits points at the account's share of the server: optimize, or move to a bigger plan.
nginx. Look for limiting requests or limiting connections in the error log: that's limit_req or limit_conn answering 503. Set limit_req_status 429; so rate-limited clients get the more accurate 429, and make sure real visitors aren't sharing a limit because nginx sees a proxy's IP address.
Load balancers and containers. A 503 with nothing in your app's log often means the balancer had no healthy target. Check health checks: the path must answer quickly with a 2xx or 3xx, and the app must be listening where the check looks.
Node, Express and Next.js. If your app returns 503 itself, it's usually a readiness check or a dependency that's down. Return it on purpose, with Retry-After, when the database is unavailable, rather than crashing.
Planned maintenance, done right. Return 503 with Retry-After, keep the maintenance page light, and keep the downtime short.
# nginx: a maintenance page with the right status
location / {
return 503;
}
error_page 503 /maintenance.html;
location = /maintenance.html {
root /var/www/site;
add_header Retry-After 600 always;
}6. On Cloudzyro
On Sites & Apps, deploys don't need a maintenance window. A new version only goes live after it starts and answers its health check, and the previous version keeps serving visitors until then. A site over its monthly traffic allowance is slowed, never taken offline. If something is wrong on our side, it shows on the status page, and the console shows a banner when it affects your workspace.
On Web Hosting, WordPress's maintenance file and slow plugins are the usual suspects; File Manager in cPanel lets you remove .maintenance.
7. How to check the status code
# Status, Retry-After and which layer answered
curl -sI https://www.example.com | grep -i -E "^HTTP|retry-after|server"In a browser, the Network tab in developer tools shows the 503 and its headers. Uptime monitors are the best way to know how often it happens; see What is uptime?.
8. Related errors
- [502 Bad Gateway](/guides/what-is-a-502-error): a proxy got a bad answer from the app.
- [504 Gateway Timeout](/guides/504-gateway-timeout): the app took too long to answer.
- [500 Internal Server Error](/guides/500-internal-server-error): the app ran and failed.
- [429 Too Many Requests](/guides/429-too-many-requests): one client is sending too much.