nginx 根目录内的主目录-禁止 403

nginx 根目录内的主目录-禁止 403

我希望我的 nginx 从我的用户主目录提供服务器文件,但是我一直收到错误 403 禁止。

nginx.conf

user http;
worker_processes  2;

error_log  logs/error.log;
error_log  logs/error.log  notice;
error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {

include       mime.types;
default_type  application/octet-stream;

sendfile        on;
keepalive_timeout  65;

#gzip  on;

server {
    listen       80;
    server_name  localhost;
    #server_name_in_redirect off;

    root   /home/txx/http/www;

    location / {
        index  index.php index.html index.htm;
    }

    location ~ \.php$ {

        try_files $uri =404;
        fastcgi_pass unix:/var/run/php56-fpm/php-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }

}

我有目录 /home/user/http/www 及其所有子文件夹设置为 775,并且都属于 http 组。

drwxrwxr-x 10 txx http 4096 20.04.2017 19:28 www/

我已经运行了“chmod 755 -R www/*”和“chmod 775 -R www”

这是怎么回事?

相关内容