/path_to_accesslog/access.log {
missingok
notifempty
size 100000k
daily
create 0644 www root
postrotate
[ ! -f /etc/nginx/logs/nginx.pid ] || kill -USR1 `cat /etc/nginx/logs/nginx.pid`
endscript
}
Explain:
missingok : do not output error if logfile is missing
notifempty : do not rotate if logfile is empty
size : Log file is rotated if it is bigger than 100000KB
daily : daily rotation
create 0644 www root : create new logfile with permission 644 where owner is www and group is root user.
postrotate
[ ! -f /etc/nginx/logs/nginx.pid ] || kill -USR1 `cat /etc/nginx/logs/nginx.pid`
endscript
=> tells nginx reload the log files .
Finish!!!
Nguyen Si Nhan
Bài đăng phổ biến
-
With this error: hudson.remoting.ProxyException: io.fabric8.kubernetes.client.KubernetesClientException: No httpclient implementations found...
-
How to create a bot to automate daily tasks using Slack Nguyen Si Nhan 1. Setting Up Your Slack App Create a Slack App: Sign in to your Sla...
No comments:
Post a Comment
Thanks for your join,we will be reply to you asap.