gpt4 book ai didi

NGINX open() 失败 (20 : Not a directory) hls vod with secure link module

转载 作者:行者123 更新时间:2023-12-04 11:19:25 28 4
gpt4 key购买 nike

我对 hls 流的 nginx 配置有问题。我用 kaltura nginx vod module并尝试添加 ngx_http_secure_link_module以保护流。奇怪的是,如果我启用 ngx_http_secure_link_module,我会出现 404 错误。 (下面的日志)。我认为这是因为它在末尾找不到带有 index.m3u8 的文件,但是如果我评论安全链接块,它就可以正常工作。

我还尝试在 location ~ \.m3u8$ {} 中添加别名阻止,但没有奏效。 我究竟做错了什么?如何保护我的流?

我的直播链接:https://stream.example.com/hls/c14de868-3130-426a-a0cc-7ff6590e9a1f/index.m3u8?md5=0eNJ3SpBd87NGFF6Hw_zMQ&expires=1609448340
我的 NGINX 配置:

server {
listen 9000;
server_name localhost;
# root /srv/static;

location ^~ /hls/ {
# the path to c14de868-3130-426a-a0cc-7ff6590e9a1f file
alias /srv/static/videos/1/;
# file with cors settings
include cors.conf;

vod hls;

# 1. Set secret variable
set $secret "s3cr3t";

# 2. Set secure link
secure_link $arg_md5,$arg_expires;
secure_link_md5 "$secure_link_expires $secret";

# if I comment this block everything works fine (but security)
location ~ \.m3u8$ {
if ($secure_link = "") { return 403; }
if ($secure_link = "0") { return 403; }
}
}
}

NGINX 日志:

cmdlogs

最佳答案

刚刚将此块移出到服务器目录并添加 vod hls;里面。

location ~ \.m3u8$ {
include cors.conf;
vod hls;

if ($secure_link = "") { return 403; }
if ($secure_link = "0") { return 403; }
}

关于NGINX open() 失败 (20 : Not a directory) hls vod with secure link module,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59518026/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com