Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nginx: fix continued writes to rotatrd modsecurity log files
Because modsecurity is not re-opening its logfile after rotation and continues to write into the same file descriptor, we need to use `copytruncate`. Better handling of that situation is stuck upstream for several years. owasp-modsecurity/ModSecurity-nginx#121 We use the presence of `/var/log/modesc_*.log` as a heuristic for modsecurity being enabled, these files are now rotated with copytruncate. All other nginx logs are still rotated by moving and reloading. Note that, due to overlapping wildcard matches, this specific case got a higher logrotate match priority and needs an `ignoreduplicates`. `copytruncate` is non-atomic and might loose some logs written between copying and the truncation being done. PL-132296
- Loading branch information