Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nixos/nginx: run nginx-config-reload as the nginx user and group
The "nginx-config-reload" script previously ran `nginx -t` as root, causing nginx to create files in /var/spool/nginx as the "nobody" user (which is the default if no user/group is specified in the nginx config itself). As further investigation showed [1], `nginx -t` does not only create files, but also tries to bind to sockets - which is a terrible thing to do to while just checking the configuration, which is why we removed the -t command from the nginx-config-reload command entirely, effectively aliasing it to systemctl reload nginx.service. Instead of all that, we now invoke `nginx -s reload` in the `ExecReload` command of `nginx.service`, which will move the unit into a failed state (but not stop the webserver). These failures are currently not properly propagated to the switch-to-configuration script, but `systemctl is-failed nginx` will return 0, and monitoring should detect this. [1]: https://trac.nginx.org/nginx/ticket/1506 Reported-By: Vincent Ambo <[email protected]>
- Loading branch information