089-Nginx 的403報錯的解決思路

針對報錯: 神馬,又遇403?  php

2018/04/04 16:42:22 [error] 8830#0: *9 open() "/application/nginx-1.6.3/html/favicon.ico" failed (13: Permission denied), client: 10.38.238.234, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "10.0.137.143", referrer: "http://10.0.137.143/"

解決思路:html

1.因爲啓動用戶和nginx工做用戶不一致所致nginx

[root@t-red7 logs]# ps aux | grep "nginx: worker process" |awk '{print $1}'
root
root

2將nginx.config的user改成和啓動用戶一致,web

命令:vi conf/nginx.confapp

3.缺乏index.html或者index.php文件,就是配置文件中index index.html index.htm這行中的指定的文件code

server {  

 listen       80;  

server_name  localhost;  

index  index.php index.html;  

root  /data/html/;

}

4.權限問題,若是nginx沒有web目錄的操做權限,也會出現403錯誤。server

chmod -R 777  /data/html

5. 防火牆緣由htm

查看:/usr/sbin/sestatusci

將SELINUX=enforcing 修改成 SELINUX=disabled 狀態io

reboot 

相關文章
相關標籤/搜索