ngx_http_estreaming_module
ngx_http_estreaming_module copied to clipboard
what about try_files?
try_files does't work ....
conf location / { ...... root /ssd/hls/; try_files /hdd0/$1 /hdd1/$1
=404; }
if possible to work try_files with this module?
can you post your config?
// begin nginx config server { listen 192.168.88.2:8081; server_name local.com;
#rewrite ^(.)/(adbr)/([0-9]+p)/([0-9]+)/(.) $1/$5?video=$4&$2=true&vr=$3 last; #rewrite ^(.)/(adbr)/([0-9]+p)/(..m3u8) $1/$4?$2=true&vr=$3 last; rewrite ^(.)/(org)/(..m3u8) $1/$3?$2=true last; rewrite ^(.)/(org)/([0-9]+)/(..ts) $1/$4?video=$3&$2=true last; #rewrite ^(._)/([0-9]+)/(._ts) $1/$3?video=$2 last;
location / { streaming; segment_length 16; hls_buffer_size 1m; hls_max_buffer_size 50m; mp4_buffer_size 1m; mp4_max_buffer_size 500m; root /ssd/hls/;
try_files /hdd0/$1 /hdd1/$1
=404; } // end nginx config
for information filesystem /ssd/hls ├── hdd0 │ ├── 124099.mp4 │ ├── long.mp4 │ ├── real_prod_file.mp4 │ ├── sample1_1500kbps.f4v │ └── test.mp4 └── hdd1 └── big.mp4
try to get http://192.168.88.2:8081/long.m3u8 or http://192.168.88.2:8081/big.m3u8
and have 404 ...
I don't understand what's your purpose when configure nginx likes that? Remember that this module does not store generated m3u8 and ts file, after response to client, it does not do anything.
nginx will try to search file long.m3u8 first here /ssd/hls/hdd0/long.m3u8 if 404 go to /ssd/hls/hdd1/long.m3u8 if no, we have error 404
So for sure you have 404, because those file (real file) will not be there.
Yes , but with config root /ssd/hls/hdd0/; without try_files work fine , may be possible to work with try_files or create analog .... in large systems with lots of disk storage is extremely convenient.
well, try_files has higher priority. I mean if try_files cannot find any available object on disk, a 404 will be return. I debug but that request does not come to my module.
Maybe there's another way....
@arty777 do you know any module that works with try_files the way you want to do? Maybe I can learn from them.
I need to be able to work with more than one HDD disk with same location. Symlinks do bad variant.
I understand your requirement, I will try to find another way to solve this problem