OPNsense Forum

Archive => 22.1 Legacy Series => Topic started by: itngo on August 04, 2022, 08:38:56 AM

Title: nginx permission denied /var/log/nginx/
Post by: itngo on August 04, 2022, 08:38:56 AM
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?
Title: Re: nginx permission denied /var/log/nginx/
Post by: itngo on August 04, 2022, 08:50:44 AM
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?
Title: Re: nginx permission denied /var/log/nginx/
Post by: itngo on August 04, 2022, 08:59:53 AM
It look like permissions get reset to www after a few minutes. Some sort of background job?
Global Error log gets flooded again.
Title: Re: nginx permission denied /var/log/nginx/
Post by: Grossartig on July 04, 2023, 12:30:37 AM
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.