O
O
OKNOZA2015-01-28 17:34:43
Nginx
OKNOZA, 2015-01-28 17:34:43

Nginx location how to give access?

location /hls {
            root /var/www/hls;
            }

There is a folder, at this address lies index.html, cutting video files and m3u8.
At the request of 127.0.0.1, the site works.
On request 127.0.0.1/hls - 404 error.
On request 127.0.0.1/hls/live.m3u8 also 404 error.
Log.
2015/01/28 17:25:22 [error] 3216#0: *1 open() "/var/www/hls/hls/live.m3u8" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /hls/live.m3u8 HTTP/1.1", host: "127.0.0.1"
2015/01/28 17:26:26 [error] 3216#0: *1 open() "/var/www/hls/hls/live.m3u8" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /hls/live.m3u8 HTTP/1.1", host: "127.0.0.1"
2015/01/28 17:30:02 [error] 3216#0: *9 open() "/var/www/hls/hls" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /hls HTTP/1.1", host: "127.0.0.1"
2015/01/28 17:30:04 [error] 3216#0: *9 open() "/var/www/hls/hls" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /hls HTTP/1.1", host: "127.0.0.1"
2015/01/28 17:30:06 [error] 3216#0: *9 "/var/www/hls/hls/index.html" is not found (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /hls/ HTTP/1.1", host: "127.0.0.1"

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
ldv, 2015-01-28
@ldvldv

nginx.org/ru/docs/http/ngx_http_core_module.html#root

location /hls/ {
            root /var/www;
            }

I
Igor, 2015-01-28
@merryjane

You can use alias , like this:

location /hls {
            alias /var/www/hls;
            }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question