Put your stack in maintenance mode so nginx returns a friendly 503 page while you work.
# Enable maintenance mode immediately
nself maintenance enable
# Check current state
nself maintenance status
# Schedule maintenance for tonight at 2 AM (UTC)
nself maintenance schedule --at "2026-05-08T02:00:00Z" --duration 30m
# Bring the site back up
nself maintenance disablenself maintenance <SUBCOMMAND> [FLAGS]nself maintenance instructs nginx to swap its normal routing rules for a maintenance page that returns HTTP 503 with a Retry-After header. All subdomains handled by your nginx instance are covered simultaneously — there is no per-app toggle.
The maintenance page is served from nginx/maintenance.html in your project directory. Edit this file to customize the message, logo, or expected downtime. If the file does not exist, ɳSelf generates a default page from your PROJECT_NAME and PUBLIC_SITE_URL.
When you run enable or schedule, ɳSelf writes a sentinel file to a shared Docker volume and sends nginx -s reload to pick it up without restarting the container. The transition is sub-second.
Switch nginx into maintenance mode immediately. All HTTP/HTTPS traffic returns 503.
| Flag | Type | Default | Description |
|---|---|---|---|
--message | string | Override the body text on the maintenance page | |
--retry-after | int | 3600 | Value for the Retry-After HTTP header, in seconds |
--allow-ip | string | Comma-separated IP addresses that bypass maintenance mode (for your own testing) |
nself maintenance enable
nself maintenance enable --message "Back in 30 minutes" --retry-after 1800
nself maintenance enable --allow-ip 203.0.113.1,203.0.113.2Remove the maintenance sentinel and restore normal nginx routing. Traffic resumes immediately.
nself maintenance disablePrint whether maintenance mode is active, how long it has been enabled, and the scheduled end time if one was set.
nself maintenance status
# Maintenance: ENABLED
# Since: 2026-05-07 14:00:00 UTC (22 minutes ago)
# Scheduled end: 2026-05-07 15:00:00 UTC (38 minutes from now)
# Allowed IPs: 203.0.113.1Schedule a maintenance window. ɳSelf enables maintenance at --at and disables it after --duration, even if you close the terminal. The schedule is persisted to disk and executed by the CLI daemon.
| Flag | Type | Required | Description |
|---|---|---|---|
--at | string | Yes | Start time in RFC3339 (e.g. 2026-05-08T02:00:00Z) or relative (e.g. +2h) |
--duration | string | Yes | How long to stay in maintenance mode. Go duration: 30m, 1h30m |
--message | string | No | Custom maintenance page message |
--cancel | bool | No | Cancel a previously scheduled window |
# Schedule 30-minute window starting at 2 AM UTC tomorrow
nself maintenance schedule --at "2026-05-08T02:00:00Z" --duration 30m
# Schedule a window 2 hours from now
nself maintenance schedule --at +2h --duration 1h
# Cancel the scheduled window
nself maintenance schedule --cancelnself maintenance enable --message "Running database migration — back shortly"
nself db migrate run
nself maintenance disable# In a crontab or CI schedule:
0 2 * * * nself maintenance enable --retry-after 1800
30 2 * * * nself maintenance disablenself maintenance enable --allow-ip $(curl -s ifconfig.me)
# Test your deployment while users see the 503...
nself maintenance disableEdit nginx/maintenance.html in your project directory. The file is served as static HTML — no templating. Restart is not required; the file is re-read on each request while maintenance mode is active.
# Your project layout:
nginx/
maintenance.html ← edit this
nginx.conf ← generated by nself build, do not hand-edit
sites/ ← generated by nself build, do not hand-edit
conf.d/ ← safe to hand-editPUBLIC_SITE_URL — used in the default maintenance page when nginx/maintenance.html does not existPROJECT_NAME — shown as the site title in the default maintenance page0 — success1 — nginx not running or failed to reload2 — invalid arguments