# Run this configuration hourly, using a dedicated logrotate state file. /var/log/nginx/anonymous.access.json { hourly rotate 6 maxsize 10M missingok notifempty compress delaycompress create 0640 www-data adm sharedscripts postrotate /usr/sbin/nginx -s reopen endscript } # Optional deployment event file. Pre-create it for the deploy operator with # group adm and mode 0640; copytruncate preserves that explicit ownership. /var/log/nginx/anonymous.deploy.json { hourly rotate 6 maxsize 1M missingok notifempty compress delaycompress copytruncate }