diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2018-04-23 17:15:17 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2018-04-23 17:15:17 +0200 |
commit | 217ec21c0ca113a78e35a0c4ca7538abfb856029 (patch) | |
tree | 61c3212f579fb390af4143896d2ba7a948b62bb3 /custom | |
parent | b68f543ed80e0e2c07e3be7340c0fad6f6ec5615 (diff) | |
download | nixos-217ec21c0ca113a78e35a0c4ca7538abfb856029.tar nixos-217ec21c0ca113a78e35a0c4ca7538abfb856029.tar.gz nixos-217ec21c0ca113a78e35a0c4ca7538abfb856029.tar.bz2 nixos-217ec21c0ca113a78e35a0c4ca7538abfb856029.tar.xz nixos-217ec21c0ca113a78e35a0c4ca7538abfb856029.zip |
rotate nginx logs
Diffstat (limited to 'custom')
-rw-r--r-- | custom/ymir-nginx.nix | 14 |
1 files changed, 14 insertions, 0 deletions
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 | |||
29 | } | 29 | } |
30 | ''; | 30 | ''; |
31 | in { | 31 | in { |
32 | services.logrotate = { | ||
33 | enable = true; | ||
34 | config = '' | ||
35 | /var/spool/nginx/logs/* { | ||
36 | compress | ||
37 | daily | ||
38 | missingok | ||
39 | rotate 4 | ||
40 | size 1M | ||
41 | su ${services.nginx.user} ${services.nginx.group} | ||
42 | } | ||
43 | ''; | ||
44 | }; | ||
45 | |||
32 | services.nginx = { | 46 | services.nginx = { |
33 | enable = true; | 47 | enable = true; |
34 | httpConfig = '' | 48 | httpConfig = '' |