A sample VCL Script, to support Fault Tolerance workflows is available with the origin server at /Origin_install/sample_scripts/varnish_sample/default.vcl
This vcl script performs the following functions:
vcl_recv:
if (req.url ~ "1\.m3u8")
{
set req.backend = b1;
}
elsif (req.url ~ "2\.m3u8")
{
set req.backend = b2;
}
vcl_miss:
if (req.url ~ "1\.m3u8") {
set bereq.url = regsub(req.url, "1\.m3u8", "\.m3u8");
}
elsif (req.url ~ "2\.m3u8") {
set bereq.url = regsub(req.url, "2\.m3u8", "\.m3u8");
1.}
Routes the set level m3u8 requests to the origin servers in the data center in a round robin manner.
Routes the set-level and stream-level f4m requests to the origins in the data center in a round robin manner.
Provides 503 failover of requests for HDS/HLS fragments and HDS manifest between the origin servers within a data center.