503 vs 504
A 503 and a 504 are both 5xx server errors that show up when a site is struggling, which is why they get lumped together. They describe different problems, and one of them is often intentional.
A 503 means the server itself is temporarily unable to handle the request, often on purpose during maintenance. A 504 means a proxy in front of the server waited for a reply and never got one.
At a glance
| Aspect | 503 | 504 |
|---|---|---|
| Meaning | Service Unavailable | Gateway Timeout |
| Where it comes from | The origin server itself | A proxy or gateway in front of the server |
| Often intentional? | Yes, common during planned maintenance | No, the backend failed to respond in time |
| Helpful header | Retry-After tells crawlers when to return | None; investigate backend speed and timeouts |
| Safe for maintenance? | Yes, with Retry-After it protects rankings | No, it signals an unplanned failure |
When a 503 is correct
A 503 is the right code for planned downtime. During maintenance, returning a 503 with a Retry-After header tells search engines the outage is temporary and when to come back, so pages keep their rankings instead of being treated as gone.
It also fires automatically when a server is overloaded and shedding requests. Either way, a 503 says 'not now, try again later' rather than 'broken'.
What a 504 points to
A 504 is not something you choose; it means a proxy or gateway waited for the backend and gave up. The backend was too slow, overloaded, or hung, and no response arrived before the timeout.
Fix it by finding why the backend is slow, speeding up the slow path, or raising the proxy timeout for requests that legitimately take longer.
Frequently asked questions
- Is a 503 bad for SEO?
- Not when it is used correctly for maintenance. A 503 with a Retry-After header tells search engines the downtime is temporary, so pages keep their rankings. The harm comes from sustained, unexplained 503s.
- How is a 504 different from a 503?
- A 503 comes from the origin server saying it is temporarily unavailable, often on purpose. A 504 comes from a proxy in front of the server reporting it got no reply from the backend in time.
- Which code should I use for planned maintenance?
- A 503 with a Retry-After header. It tells crawlers the outage is intentional and temporary so they return later without dropping your pages from the index.
Full reference
Related comparisons
See what your own site returns
Check the live status code of your URLs to tell a 503 apart from a 504 during an outage.