當Nginx讀取本地目錄時如果收到403錯誤改艇,是由于nginx的權限問題。
修改nginx的權限:
[root@iZ2834tthbyZ ~]# cd ~
[root@iZ2834tthbyZ ~]# cd /etc/nginx/
[root@iZ2834tthbyZ nginx]# vim nginx.conf
編輯nginx.conf
user nginx; 改為 user root;
按esc進入命令模式
輸入:wq保存退出
重新啟動nginx:
[root@iZ2834tthbyZ nginx]# cd ~
[root@iZ2834tthbyZ ~]# nginx -s reload