brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: nginx -s reload lets old workers finish their requests, a restart does not

Nginx
~/tips/tip-nginx-reload-graceful-workers

sudo nginx -s reload

Applies a changed configuration while connections that are in progress finish normally.

A restart cuts every open connection, while a reload swaps the configuration without dropping anyone.

sudo nginx -s reload
ps -o pid,etime,cmd -C nginx

On reload the master process reads the new config, starts new workers and tells the old ones to stop taking new connections and exit when their requests are done. They show up as nginx: worker process is shutting down. If the new config is invalid the master keeps running with the old one. A long download or WebSocket can keep an old worker alive for hours, and worker_shutdown_timeout 30s; in the main context caps that wait.

Further reading: Controlling nginx

Going deeper: 🛜 Guide: AdGuard Home + Tailscale (Secure Split-Horizon DNS)

More Nginx tips sudo certbot --nginx -d example.com -d www.example.com /data/nginx/custom/server_redirect.conf map $http_upgrade $connection_upgrade { proxy_intercept_errors on; proxy_redirect http://localhost:3000/ /app/; All Nginx tips (50) All topics

Link