nginx
loadbalancer.nginx
Protects against destructive nginx load balancer operations like stopping the service or deleting config files.
- 5blocking rules
- 7safe patterns
- 1Critical
- 4High
[packs]
enabled = ["loadbalancer.nginx"]Evaluated when a command contains nginx.
Blocking rules
Each rule ID is loadbalancer.nginx:<name>. Use it in allowlists and [policy.rules].
Criticalnginx-config-deleteRemoving files from /etc/nginx deletes nginx configuration.
Explanation
Deleting nginx configuration files removes site definitions, upstream blocks, SSL certificate references, and load balancing rules. Nginx will fail to start or reload without valid configuration. Back up config first: cp -r /etc/nginx /etc/nginx.backup Test config validity: nginx -t
Highnginx-quitnginx -s quit gracefully stops nginx and halts traffic handling.
Explanation
The quit signal waits for active connections to complete before shutting down nginx. While graceful, it still permanently stops the load balancer and no new connections are accepted once issued. To reload config without stopping: nginx -s reload Test config before changes: nginx -t
Highnginx-stopnginx -s stop shuts down nginx and stops the load balancer.
Explanation
Sending the stop signal terminates nginx immediately without waiting for active connections to finish. All in-flight requests are dropped and upstream traffic stops being routed. To reload config without downtime: nginx -s reload To gracefully finish current requests: nginx -s quit
Highservice-stop-nginxservice nginx stop stops the nginx service and disrupts traffic.
Explanation
Stopping nginx via the legacy service command terminates all worker processes. All sites and proxies served by nginx become unavailable. Check status first: service nginx status Prefer systemctl on systemd systems: systemctl status nginx
Highsystemctl-stop-nginxsystemctl stop nginx stops the nginx service and disrupts traffic.
Explanation
Stopping the nginx systemd service shuts down all nginx worker processes. Any sites, APIs, or reverse proxies served by this nginx instance become unreachable until the service is restarted. Check status first: systemctl status nginx To restart instead of stop: systemctl restart nginx
Safe patterns
Checked first. A command that matches one is never blocked by this pack.
nginx-config-testnginx-config-dumpnginx-versionnginx-version-fullnginx-reloadsystemctl-status-nginxservice-status-nginx