# libmodsecurity holds SecAuditLog itself and ignores nginx USR1, so
# modsec_audit.log must not match this glob (a second stanza would then
# be a duplicate log entry and would not copytruncate).
/var/log/nginx/*access.log /var/log/nginx/*error.log /var/log/nginx/sites/*.log /var/log/nginx/webapps/*/*.log /var/log/nginx-grafana/*.log {
    daily
    missingok
    rotate 30
    compress
    delaycompress
    notifempty
    create 0640 www-data adm
    sharedscripts
    postrotate
        if [ -s /run/openresty.pid ]; then
            kill -USR1 "$(cat /run/openresty.pid)" 2>/dev/null || true
        fi
    endscript
}

/var/log/nginx/modsec_audit.log {
    daily
    missingok
    rotate 30
    compress
    delaycompress
    notifempty
    copytruncate
}
