---
title: "Say when you'll be back · Agent Wranglers"
url: https://agentwranglers.se/playbook/website/when-things-break/maintenance-pages
updated: 2026-10-20
licence: "All rights reserved"
---

# Say when you'll be back

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Recommended
- Chapter: [When things break](https://agentwranglers.se/playbook/website/when-things-break)
- Rule: During planned maintenance, answer 503 with `Retry-After` and a clear page. Keep the health check working.
- How: Add a maintenance switch. When it is on, pages answer 503 with `Retry-After` and `Cache-Control: no-store`, while the health check stays up. Never answer 200 or redirect to a maintenance page, or search engines index it in place of your pages. Keep it under a day, because search engines start dropping pages after a few days of 503.
- Check: With the switch on, `curl -sI` on a page answers 503 with `Retry-After`, and the health check answers 200.

Example:

```nginx
# Turn on with: touch /var/www/maintenance.on
location = /healthz { proxy_pass http://127.0.0.1:8080; }
location / {
  if (-f /var/www/maintenance.on) { return 503; }
  proxy_pass http://127.0.0.1:8080;
}
error_page 503 /maintenance.html;
location = /maintenance.html {
  root /var/www;
  add_header Retry-After 1800 always;
  add_header Cache-Control no-store always;
  internal;
}
```

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers website playbook: https://agentwranglers.se/playbook/website/when-things-break/maintenance-pages`.

- Previous: [Make error pages helpful and honest](https://agentwranglers.se/playbook/website/when-things-break/error-pages)
- Next: [Keep working when a script or service fails](https://agentwranglers.se/playbook/website/when-things-break/graceful-degradation)
- [When things break](https://agentwranglers.se/playbook/website/when-things-break)
