implementation of access.log with if condition

lifeisjustabout nginx-forum at
Mon Jul 31 14:33:08 UTC 2017

Thanks for response,

> Setup log rotation depending on size of logs or daily rotation. 
If I use log rotation would I still have access to all access data logs
where I moved? 

>Instead of randomly restarting – do a config check and only restart if the
config is valid (should also validate the log location) 
There is a scheduled script restarts server to close some program sockets
once every week. Sorry I didn't explain correctly. 

>You write in your initial post that if the access log exists, then you
should use the external hard drive, however – have you considered that the
file might exist but the device is in read-only? 
I never had problem before on this servers external hdd In terms of device
never become read only for last 3 years.

>You could also symlink /externalhdd/log/nginx to /var/log/nginx – in this
case if the drive is mounted it would use the external drive, if it’s not
mounted the file would get written to your SSD – but still won’t make up for
a read only device in case that happens. 
My friend is also suggested symblink, I will look on this suggestion 

thank you.

Posted at Nginx Forum:,275761,275770#msg-275770

More information about the nginx mailing list