mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-11-02 18:17:11 +09:00
Host nginx is the front door for every managed app (it reverse-proxies their containers via /etc/nginx/serverkit-locations/*.conf). The updater used to `systemctl stop nginx` for the whole blue/green switch window, which blacked out every unrelated hosted site for 10-60s during a panel update. The slot switch only ever changes nginx config, never anything nginx serves from the slot, so a stop was never required. Add reload_nginx_graceful(): validate config (nginx -t) then `systemctl reload nginx` - keeps listening sockets and in-flight connections alive, so apps never blink. Starts nginx if it happens to be down. Wired into both the forward update flow and rollback(); only the panel backend is now cycled. Dropped the stray frontend-only `docker compose up -d backend` line. Tests: T11 reloads-not-stops a running nginx, T12 starts a stopped nginx, T13 guards against `systemctl stop nginx` reappearing. 13 passed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>