5xx Server errors
HTTP 503 Service Unavailable
HTTP 503 Service Unavailable means the server is temporarily unable to handle the request, for example during maintenance or overload.
What 503 Service Unavailable means
A 503 is the honest answer when the app is up but cannot serve right now: a dependency such as the database or an upstream API is down, the server is overloaded, or it is in maintenance. Add Retry-After so clients and crawlers know when to come back.
Common causes
- Planned maintenance.
- A required backend or database is unreachable.
- A free-tier API that is cold-starting.
How to fix or use it
Return 503 with Retry-After for temporary outages instead of 200 with an error message or a 404. In SSR, set status 503 when the page data could not load, so caches and crawlers do not store the broken page.
Express (Node.js) example
app.use((req, res, next) => {
if (!db.isConnected()) return res.status(503).set('Retry-After', '120').json({ message: 'Try again shortly' });
next();
});SEO impact
Google treats 503 as temporary and keeps the page indexed for a while, which makes it the right code for planned downtime. A 503 lasting more than a few days starts to drop pages.
