原文链接:https://blog.csdn.net/fengxiaolu311/article/details/124685505
Nginx 查看日志报错:
(13: Permission denied)
tail -f /var/log/nginx/error.log
open() "/var/log/cyberwing-webui-20220507.log" failed (13: Permission denied) while logging request
1
2
解决办法
1、查看nginx启动用户和使用用户是否一致
ps aux | grep nginx
1
master process 、worker process 两个进程的用户不一样
2、修改用户
打开 Nginx的配置文件
vim /etc/nginx/nginx.conf
user nginx;
worker_processes 8;
1
2
3
4
把 nginx 改为 root
3、重启nginx,再次查看用户是否一致
service nginx restart
ps aux | grep nginx
1
2
用户一致,现在可以正常访问了