503 Service Unavailable means the server is temporarily unable to handle the request due to overload or maintenance. The server is alive but cannot take requests right now — an intentional or temporary condition.
A well-formed 503 uses a Retry-After header to say when to try again. During planned deploys or maintenance it also serves as a proper "we're down for maintenance" page for users.
GET / HTTP/1.1
Host: www.example.comHTTP/1.1 503 Service Unavailable
Retry-After: 120
Content-Type: text/html
<h1>503 Service Unavailable</h1>
<p>We are down for maintenance. Please try again shortly.</p>app.use((req, res, next) => {
if (process.env.MAINTENANCE === '1') {
return res.status(503).set('Retry-After', '120').send('Under maintenance');
}
next();
});location / {
if (-f /etc/nginx/maintenance.on) {
return 503;
}
proxy_pass http://backend;
}
error_page 503 /maintenance.html;