From 217ec21c0ca113a78e35a0c4ca7538abfb856029 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 23 Apr 2018 17:15:17 +0200 Subject: rotate nginx logs --- custom/ymir-nginx.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/custom/ymir-nginx.nix b/custom/ymir-nginx.nix index 16d48d16..e5b2f162 100644 --- a/custom/ymir-nginx.nix +++ b/custom/ymir-nginx.nix @@ -29,6 +29,20 @@ let } ''; in { + services.logrotate = { + enable = true; + config = '' + /var/spool/nginx/logs/* { + compress + daily + missingok + rotate 4 + size 1M + su ${services.nginx.user} ${services.nginx.group} + } + ''; + }; + services.nginx = { enable = true; httpConfig = '' -- cgit v1.2.3