Open reformhaus opened 5 years ago
This is not supported, nginx-vod-module will get the 404 and fail the request. You may be able to solve it using mapped mode - nginx-vod-module will hit some upstream server that "knows" whether the sync completed or not, and return a working URL to the MP4.
Hi ReformHaus,
you can try this solution:
upstream origin { storage_b.blob.core.windows.net; origina.com backup; } #########################
location /hls/ {
vod hls;
vod_mode remote;
vod_upstream_location /remote;
vod_cache_buffer_size 8m;
add_header Access-Control-Allow-Headers '*';
add_header Access-Control-Expose-Headers 'Server,range,Content-Length,Content-Range';
add_header Access-Control-Allow-Methods 'GET, HEAD, OPTIONS';
add_header Access-Control-Allow-Origin '*';
expires 100d;
}
location ^~ /remote/hls/ {
internal;
proxy_pass https://origin;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host storage_B.blob.core.windows.net;
proxy_next_upstream error timeout http_401 http_403 http_404 http_500 http_502 http_503 http_504;
}
My concept is using upstream for proxy_pass in progress of module, it will sub-request to /remote location and waiting response data from there. So if you using upstream, the proxy_pass module will try next_upstream before return hls location
the limitation of this solution is all upstreams must the same scheme and Host Header but i think this limitation is very easy to resolve
Many thanks first of all for the great tool. I have now tried a little and have the following requirement: I synchronize my media files from Origin_A to Storage_B. Storage_B is configured as vod_upstream_location in nginx-vod-module. Playing from remote location works fine! I would now like to have assets that are not yet available on Storage_B (sync running) retrieved from Origin_A. My previous tests were not successful: