nginx解析php请求为404

刚搭建了lnmp环境,发现如果讲我的程序放在某个文件夹的时候,然后nginx进行代理的时候竟然会是404;

nginx配置如下:

   # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
            root           /home/morequ/morequ-wordpress;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  info.php;
            fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }

但是怎么请求都是404,

后来发现是liunx权限的问题,发现我的nginx是root用户启动的,但是没有读取morequ的权限

赋权即可:

# chomd 777 /home/morequ
# chomd 777 /home/morequ/morequ-wordpress

 

 

你可能感兴趣的:(nginx解析php请求为404)