I've a nginx reverse proxy with custom log files (depending on hostname)
pwd : /var/log/nginx/domain/fqdn.(log|err)
Since some time (maybe after switching to Ubuntu 23.10), my log files are very often empty.
Here is the logrotate config
root@rev-proxy:~# cat /etc/logrotate.d/nginx
/var/log/nginx/*/*.log {
daily
missingok
rotate 14
compress
delaycompress
notifempty
create 0640 www-data adm
sharedscripts
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
run-parts /etc/logrotate.d/httpd-prerotate; \
fi \
endscript
postrotate
invoke-rc.d nginx rotate >/dev/null 2>&1
endscript
}
After logrotate run, nginx can't log anymore to the differents log files until i reload / restart / force logrotate.
I've tried to replace invoke-rc.d nginx rotate >/dev/null 2>&1
with invoke-rc.d nginx reload >/dev/null 2>&1
but not working.
Last logs of last file are always between 00:00 and 00:15. So i think this is when logrotate is rotating the logs.
All log files have www-data:adm
owner with 644 mask.
Does someone have an idea ?
Thank's
invoke-rc.d nginx rotate
on the command line?