How to specify the permissions of log files in nginx?
大家讲道理
大家讲道理 2017-05-16 17:21:43
0
2
1040

The thing originated from such a scene:

nginxRun as user_www, the permissions of log filesaccess.logand so on are:
_www _www rw------ -

And I now need to let another user read the file, so I want to be able to specify the permissions of the log file. After searching, I didn't find thatnginxprovides this configuration, and I was very confused.

Please give me some advice.

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all (2)
phpcn_u1582

Don’t use the chmod command to modify file permissions? This way other users can read it.

    给我你的怀抱

    cat /etc/logrotate.d/nginx

    /var/log/nginx/*.log {

    daily missingok rotate 52 compress delaycompress notifempty create 644 nginx root sharedscripts postrotate [ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid` endscript

    }
    Change the log rolling configuration

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!