From aee23b342e1f7eed4471e7435b3c5ae4e09ac47c Mon Sep 17 00:00:00 2001 From: "Julio Cesar Camargo (JCC)" Date: Thu, 15 Nov 2018 14:25:12 -0200 Subject: [PATCH] simple log rotation routine based on newsyslog @franco (#982) * simple log rotation routine based on newsyslog @franco * typo error * set file permissions to 640 --- .../src/opnsense/service/templates/OPNsense/Nginx/+TARGETS | 1 + .../opnsense/service/templates/OPNsense/Nginx/newsyslog.conf | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 www/nginx/src/opnsense/service/templates/OPNsense/Nginx/newsyslog.conf diff --git a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/+TARGETS b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/+TARGETS index 320f535db..abf4ee699 100644 --- a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/+TARGETS +++ b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/+TARGETS @@ -5,3 +5,4 @@ mime.types:/usr/local/etc/nginx/mime.types php_fpm:/etc/rc.conf.d/php_fpm php-www.conf:/usr/local/etc/php-fpm.d/www.conf php-webgui.conf:/usr/local/etc/php-fpm.d/webgui.conf +newsyslog.conf:/etc/newsyslog.conf.d/nginx diff --git a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/newsyslog.conf b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/newsyslog.conf new file mode 100644 index 000000000..fa136d6a5 --- /dev/null +++ b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/newsyslog.conf @@ -0,0 +1,5 @@ +# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] +{% if helpers.exists('OPNsense.Nginx') %} +/var/log/nginx/*access.log www:www 640 14 * @T00 GZB /var/run/nginx.pid 30 +/var/log/nginx/*error.log www:www 640 14 * @T00 GZB /var/run/nginx.pid 30 +{% endif %}