Macos nginx 403权限被拒绝

Macos nginx 403权限被拒绝,macos,nginx,Macos,Nginx,我正在尝试在OSX上使用nginx设置HLS服务器。下面的conf文件给了我一个被拒绝的403权限有人能告诉我为什么会发生这种情况吗?我尝试使用chmod更改文件夹的权限。那也没用 配置文件: worker_processes auto; events { worker_connections 1024; } RTMP configuration rtmp { server { listen 1935; # Listen on standard RTMP port chun

我正在尝试在OSX上使用nginx设置HLS服务器。下面的conf文件给了我一个被拒绝的
403权限
有人能告诉我为什么会发生这种情况吗?我尝试使用
chmod
更改文件夹的权限。那也没用

配置文件:

worker_processes  auto;
events {
worker_connections  1024;
}

RTMP configuration
rtmp {
server {
    listen 1935; # Listen on standard RTMP port
    chunk_size 4000;

    application show {
        live on;
        # Turn on HLS
        hls on;
        hls_path /Users/anil/hls/hls/;
        hls_fragment 3;
        hls_playlist_length 60;
        # disable consuming the stream from nginx as rtmp
        deny play all;
    }
}
}

http {
sendfile off;
tcp_nopush on;
#aio on;
directio 512;
default_type application/octet-stream;

server {
    listen 8080;

    location / {
        # Disable cache
        add_header 'Cache-Control' 'no-cache';

        # CORS setup
        add_header 'Access-Control-Allow-Origin' '*' always;
        add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
        add_header 'Access-Control-Allow-Headers' 'Range';

        # allow CORS preflight requests
        if ($request_method = 'OPTIONS') {
            add_header 'Access-Control-Allow-Origin' '*';
            add_header 'Access-Control-Allow-Headers' 'Range';
            add_header 'Access-Control-Max-Age' 1728000;
            add_header 'Content-Type' 'text/plain charset=UTF-8';
            add_header 'Content-Length' 0;
            return 204;
        }

        types {
            application/dash+xml mpd;
            application/vnd.apple.mpegurl m3u8;
            video/mp2t ts;
        }

        root /Users/anil/hls;
    }
}
}

提前感谢。

您提供了什么cmod?您是否将根目录从/usr/share/nginx/html更改?我也有同样的问题。恢复到默认路径为我解决了这个问题,我给他们发了一封电子邮件。@Jorg我尝试了chmod 777以确保一切正常。@ShawnicHedgehog我想我的根目录不在/usr/share/nginx/html中。我通过brew安装了它。可能是别的地方吗?我解决了这个问题。我的位置在/usr/local/var/www。做了那个改变,它成功了。谢谢各位