Empty error and access log

krishna nginx-forum at forum.nginx.org
Fri Sep 27 05:36:55 UTC 2019


Hello All,

Thanks for the updates.

Figured out that, nginx.pid file doesn't have the correct PID value(it
contains 1)  - which could be valid since nginx is running inside docker
container and we are setting up the log rotation from the host machine where
the log files getting rotated but new files not getting logged further by
nginx worker process.

As per the comments tried to edit the nginx.pid file(with Nginx host PID), 
then issued command "kill -USR1 `cat /var/run/nginx.pid`" which works fine
and new log files getting created and logged with data.

Had came across the blogs, they suggested to use nginx reload during post
rotation as below with the logrotate,
 postrotate
     docker exec nginx bash -c "nginx -s reload 2>/dev/null"
 endscript

Kindly let me know, if above is a valid approach can be followed (or)  to
get the actual Nginx PID at host level & initiate kill command with USR1.

Thanks in advance.
Regards,
Krishna

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,285708,285726#msg-285726



More information about the nginx mailing list