NGX_LOG_DIR/*.log {
    daily
    rotate 20
    size=100M
    nodateext
    copytruncate
    compress
    sharedscripts
    notifempty
    postrotate
      [ -f NGX_LOG_DIR/openresty.pid ] && kill -USR1 `cat NGX_LOG_DIR/openresty.pid`
      # reset ownership to comply with directory's permissions
      # chmod 644 NGX_LOG_DIR/*.log*
    endscript
    missingok
    su root root
}
