nginx permission denied /var/log/nginx/

Started by itngo, August 04, 2022, 08:38:56 AM

Previous topic - Next topic
Yesterday we changed log rotation and cleared logs in opnsense.
Since nginx LOG/GlobalError is flooding with open() "/var/log/nginx/FILE_NAME_REPLACED.access.log" failed (13: Permission denied)

What can we do?

Look like when you clear logs, permission get wrong.
New log files where with owner "www", after deleting files and apply nginx config files get created with owner "root" and logging is working again.... BUG?

It look like permissions get reset to www after a few minutes. Some sort of background job?
Global Error log gets flooded again.

Late response, but since you didn't get a response, and since I just had the same issue, I hope the following helps. The ownership of /var/log/nginx was root, but I had to change the ownership of that particular folder to www. This still allowed all log files to be written, but for the web UI to access them as well.

Unclear how it got messed up in the first place. I am currently on 23.1.11 but had the issue at least since 23.1.9, if not much earlier and never noticed until now.