What 503 means
The server can't handle the request right now, because it's overloaded or down for maintenance, and expects to recover. 503 is defined in RFC 9110 §15.6.4. Unlike 500, it says the problem is temporary, and the server can say when to come back with Retry-After (seconds or an HTTP date):
HTTP/1.1 503 Service Unavailable
Retry-After: 3600
Content-Type: text/html
<h1>Down for maintenance</h1><p>Back within the hour.</p>
Common causes
- Planned maintenance with a maintenance page switched on (WordPress writes a
.maintenancefile during updates and answers 503 until it's done). - Overload protection: the server or app refuses new work when its queue or connection pool is full.
- No healthy backends: a load balancer, Kubernetes Service or HAProxy backend with every target failing its health check.
- Hosting limits: shared hosts return 503 when an account exceeds its process or CPU limits.
- Rate limiting set up with 503 (nginx's
limit_reqdefault status is 503;limit_req_status 429is clearer).
How to serve it for maintenance
Return 503 with Retry-After on every page, and keep the status even though you show a friendly page. In nginx:
error_page 503 /maintenance.html;
location = /maintenance.html {
internal;
add_header Retry-After 3600 always;
}
location / {
if (-f /var/www/maintenance.on) { return 503; }
try_files $uri $uri/ /index.php?$args;
}
In Apache, add this block for the duration of the work and remove it afterwards (the Header line applies to every response):
ErrorDocument 503 /maintenance.html
Header always set Retry-After "3600"
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/maintenance.on -f
RewriteCond %{REQUEST_URI} !=/maintenance.html
RewriteRule ^ - [R=503,L]
Never redirect everything to a maintenance URL that returns 200: search engines would see one page replacing the whole site.
How to fix an unexpected 503
- Find which layer sends it from the
Serverheader and the error page (nginx, a load balancer, a CDN, the app). - For load balancers, check the health of each target and what the health-check URL returns.
- Look for resource exhaustion: CPU, memory, worker counts, database connections.
- As a client, honour
Retry-Afterand back off; don't retry in a tight loop.
503 and SEO
503 is Google's recommended way to take a site down temporarily. Googlebot slows its crawling when it sees 5xx responses, and already indexed URLs are kept for a while. If the 503 lasts more than a few days, Google treats it as a lasting error and starts dropping URLs from the index. A 503 on robots.txt pauses crawling of the whole site. Google documents its slowdown in general terms, so don't count on Retry-After setting Googlebot's exact return time.
Related codes
- 429 Too Many Requests: one client exceeded a rate limit, also with
Retry-After. - 502 Bad Gateway and 504 Gateway Timeout: a proxy couldn't get a good answer in time.
- 500 Internal Server Error: an unexpected failure, not a planned one.
Check that your maintenance page really answers 503 with the Redirect Checker, or inspect the headers with the HTTP Request Builder.