nixos/nginx: add systemd-tmpfiles exclusion of temporary directories

Directories used by nginx in the tmp path are only created upon startup and
must not be deleted while nginx is running.
This commit is contained in:
Marek Beyer 2023-09-28 13:48:56 +02:00
parent 040cf48d28
commit ea1eb4ee0f
No known key found for this signature in database

View file

@ -1340,6 +1340,11 @@ in
nginx.gid = config.ids.gids.nginx;
};
# do not delete the default temp directories created upon nginx startup
systemd.tmpfiles.rules = [
"X /tmp/systemd-private-%b-nginx.service-*/tmp/nginx_*"
];
services.logrotate.settings.nginx = mapAttrs (_: mkDefault) {
files = "/var/log/nginx/*.log";
frequency = "weekly";