How to Fix a 503 Service Unavailable Error
Tell an outage from a rate limit or a failing proxy, then retry the way the server asks.
Updated
TL;DR
503 Service Unavailable means the server that answered cannot take requests for a while; it may be the site's app, its load balancer or CDN, or your proxy. Wait a few minutes before you reload the page.
How servers and clients word a 503
Server pages name the sender; browsers and libraries print their own text around the code.
| Where | What you see |
|---|---|
| nginx (default error page) | 503 Service Temporarily Unavailable |
| Apache httpd (default error page) | Service Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later. |
| HAProxy (no server available) | 503 Service Unavailable No server is available to handle this request. |
| Chrome (503 with an empty body) | This page isn't working. shop.example.org is currently unable to handle this request. HTTP ERROR 503 |
| Varnish Cache (built-in error page) | Error 503 Backend fetch failed |
| Python requests (raise_for_status) | requests.exceptions.HTTPError: 503 Server Error: Service Unavailable for url: https://api.example.org/items |
| Node.js with axios | AxiosError: Request failed with status code 503 |
Why this happens
The site is too busy or closed for maintenance, so it turns visitors away.
Most often the site's app is overloaded, or the load balancer in front of it has no working server. Rate limiters send 503 too: nginx does by default, and Amazon S3 says Slow Down.
Diagnose your 503 first
Each check rules out one sender, starting with two you can run in any browser.
Look for a return time or the word maintenance on the page; if either appears, the owner took the site down on purpose.
View the page source and search for cloudflare; if found, a Cloudflare data center sent the 503, otherwise the site or your proxy did.
If only your script gets 503, run it with one connection; if the 503s stop, a rate limiter sent them.
Run curl -v through the proxy; a 503 right after CONNECT is the proxy's, one after the proxy's 200 is the site's.
Search your nginx error log for limiting requests at the 503's time; a match means your own rate limit, not overload, sent it.
Solutions ranked by effectiveness
The first card clears most 503s; the second covers a failing proxy, the third your own server.
- Most common fix
Retry once after the requested wait
For scripts and apps: wait at least the time Retry-After gives, in seconds or as a date, or 30 seconds without it. Retry once; give up if the server asks for over five minutes.
curl -sS --retry 1 --retry-delay 30 --retry-max-time 300 \ -o page.html -w '%{http_code}\n' \ https://example.com/ - Check next
Fix the proxy route when only it fails
Applies when the proxy refused the request itself and the site loads without it.
Fix any typo in the hostname; Squid answers 503 when a name does not resolve.
Lower how many connections you open through the proxy at the same time.
If it keeps failing, give your provider the time, target host and proxy port.
- Site owners
Restore the backend or relabel the limit
For a 503 from your own app, Apache, HAProxy or nginx: apply the change that matches its log, then test and reload the config.
If app logs show CPU, memory or connection pool exhaustion, add capacity.
If Apache logs AH00957, start the backend it names or fix that ProxyPass address.
If HAProxy requests wait past timeout queue, add servers or raise maxconn where safe.
Set limit_req_status and limit_conn_status to 429, so clients read a limit, not an outage.
Stop the 503 from coming back
Owners can make 503s shorter and clearer; script authors can avoid becoming part of the load.
Send Retry-After with planned maintenance 503s, so clients and Google's crawlers know when to return.
Keep 503 responses out of caches, since a cached error page can outlive the fix.
End maintenance 503s within a day or two; Google slows crawling and eventually drops URLs that keep failing.
Add a few random seconds to each worker's retry wait, so they do not all return at once.
Related errors
Learn more
FAQ
An IP no stranger shares
Only you use a Dedicated ISP IP, so a per-IP limit counts just your requests.


