VCL requirements

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:

  1. 1. Routes the stream-level m3u8 request to the correct origin using the origin number suffix attached to the stream name. In other words, it maps livestream1 to origin 1 and livestream2 to origin 2. To implement this, selecting the appropriate backend in vcl_recv subroutine and modify the outgoing URL to remove the extra qualifier in vcl_miss subroutine:
    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.}
    
  2. Routes the set level m3u8 requests to the origin servers in the data center in a round robin manner.

  3. Routes the set-level and stream-level f4m requests to the origins in the data center in a round robin manner.

  4. Provides 503 failover of requests for HDS/HLS fragments and HDS manifest between the origin servers within a data center.