You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a file /etc/logrotate.d/openresty with contents
# Make sure to first set the selinux context on the directory and files otherwise logrotate won't work
# semanage fcontext --add --type var_log_t '/usr/local/openresty/nginx/logs(/.*)?'
# restorecon -Frvv /usr/local/openresty/nginx/logs
/usr/local/openresty/nginx/logs/access.log /usr/local/openresty/nginx/logs/error.log {
daily
missingok
rotate 30
compress
delaycompress
notifempty
create 644 root root
sharedscripts
postrotate
if [ -f /usr/local/openresty/nginx/logs/nginx.pid ]; then
kill -USR1 `cat /usr/local/openresty/nginx/logs/nginx.pid`
fi
endscript
}
Set the selinux policy and file contexts by running
Enable log rotation of openresty web server logs.
Create a file
/etc/logrotate.d/openresty
with contentsSet the selinux policy and file contexts by running
I've done this manually on the live server but it's not captured here in the infrastructure-as-code
The text was updated successfully, but these errors were encountered: