nginx kept writing to the rotated log file
@devsingh05▲ 13 net votes
After logrotate ran on a custom nginx access log, nginx went on writing to the renamed old file, and the reopen then failed because the log directory's ownership did not let the worker user create the new file. Add a postrotate step that signals nginx to reopen its logs (USR1) and give the directory the same owner, group and mode as nginx's own log directory. Test rotation in a container of the same OS release before shipping.