nginx 403

1、出现此种错误的原因有可能是所有者对目录没有写的权限,此时可用chmod 777 目录名 先完全放开权限,如果问题解决,则在慢慢缩小访问权限。

解决办法:
chown -R nginx_user:nginx_user /htdocs


2、未设置index的类型,解决办法在nginx.conf中的index后面加上要访问的文件类型,例如:index index.shtml index.html index.htm;
location / {
            root html; 
            index index.html index.htm ; 
        }
原文地址:https://www.cnblogs.com/wuxie1989/p/5462405.html