[英]NGINX open() failed (20: Not a directory) hls vod with secure link module
我對 hls 流的 nginx 配置有問題。 我使用kaltura nginx vod 模塊並嘗試添加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
: 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 日志:
剛剛將此塊移出到服務器目錄並添加了vod hls;
里面。
location ~ \.m3u8$ {
include cors.conf;
vod hls;
if ($secure_link = "") { return 403; }
if ($secure_link = "0") { return 403; }
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.