From 5d256035c6c2c8685b8735141539c7e3bf835a74 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 16 Apr 2015 11:30:37 +1000 Subject: [PATCH] FIX: broken nginx log file rotation --- templates/web.template.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/templates/web.template.yml b/templates/web.template.yml index c094b7a..c40452e 100644 --- a/templates/web.template.yml +++ b/templates/web.template.yml @@ -189,15 +189,22 @@ run: endscript } - - replace: - filename: "/etc/logrotate.d/nginx" - from: "weekly" - to: "daily" - - - replace: - filename: "/etc/logrotate.d/nginx" - from: "52" - to: "14" + - file: + path: /etc/logrotate.d/nginx + contents: | + /var/log/nginx/*.log { + daily + missingok + rotate 14 + compress + delaycompress + notifempty + create 0640 www-data adm + sharedscripts + postrotate + sv 1 nginx + endscript + } # move state out of the container this fancy is done to support rapid rebuilds of containers, # we store anacron and logrotate state outside the container to ensure its maintained across builds -- 2.25.1