Goodwalk
-Be right back!
-We're updating the site — should only take a minute. Thanks for your patience.
- -diff --git a/nginx/goodwalk.co.nz.svelte.conf.example b/nginx/goodwalk.co.nz.svelte.conf.example index e509f4d..77192db 100644 --- a/nginx/goodwalk.co.nz.svelte.conf.example +++ b/nginx/goodwalk.co.nz.svelte.conf.example @@ -53,6 +53,26 @@ server { # nginx does not keep stale upstream IPs in memory. resolver 127.0.0.11 ipv6=off valid=30s; + # Maintenance mode: when /etc/nginx/conf.d/maintenance.flag exists, + # serve the static "be right back" page with a 503 status. The flag is + # toggled by the deploy script (touch / rm) without reloading nginx. + error_page 503 /maintenance.html; + + location = /maintenance.html { + root /var/www/html; + internal; + add_header Cache-Control "no-store" always; + } + + # Static assets used only by the maintenance page (logo, etc.). Served + # directly from the nginx html mount so they remain reachable while the + # SvelteKit app is down. + location /m/ { + root /var/www/html; + access_log off; + add_header Cache-Control "public, max-age=3600" always; + } + location ~* /\.(git|env|htaccess) { deny all; } @@ -66,6 +86,10 @@ server { } location /api/submit { + if (-f /etc/nginx/conf.d/maintenance.flag) { + return 503; + } + set $goodwalk_mail_api goodwalk_svelte_mail_api:8000; limit_req zone=goodwalk_limit burst=10 nodelay; proxy_pass http://$goodwalk_mail_api/submit; @@ -77,6 +101,10 @@ server { } location / { + if (-f /etc/nginx/conf.d/maintenance.flag) { + return 503; + } + set $goodwalk_frontend goodwalk_svelte_app:3000; proxy_pass http://$goodwalk_frontend; proxy_http_version 1.1; diff --git a/nginx/logo.png b/nginx/logo.png new file mode 100644 index 0000000..f3b19a5 Binary files /dev/null and b/nginx/logo.png differ diff --git a/nginx/maintenance.html b/nginx/maintenance.html index ad460cd..349392b 100644 --- a/nginx/maintenance.html +++ b/nginx/maintenance.html @@ -8,8 +8,8 @@
-Goodwalk
-We're updating the site — should only take a minute. Thanks for your patience.
- -