Page 1 of 1

How do I increase / rotate nginx logs in Vesta CP

Posted: Fri Jan 29, 2021 9:13 am
by annahernandez99
I am using Vesta CP with Nginx as a proxy for Apache and I need Nginx access logs of one of my domain for more than 3-4 days, but when I check /home/admin/web/domain/logs/domain.log

It contains a single file with very limited logs, that gets updated everyday and previous logs get cleaned.

I tried messing with logrotate with the following configurations

/home/admin/web/domain/logs/log/*log {
create 0644 nginx nginx
daily
rotate 10
missingok
notifempty
compress
sharedscripts
postrotate
[ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`
endscript
}
but it is not working.

when I check Apache logs, they are perfectly being rotated. but I want nginx access logs for my domains to be rotated or at least store it for 3-4 days.

I don't know if there's any different solution other than logrotate to do this.

Please Help...

PS. I don't understand why we are putting this line in logrotate conf, some guidance would be a great help.

[ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`