Advertisement
and_cesbo

HLS Retransmit

Jul 14th, 2017
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 0.80 KB | None | 0 0
  1. # http://address:port - address to original HLS server
  2. # /ramcache - directory for cache. mount -t tmpfs tmpfs /ramcache
  3.  
  4. server {
  5.     listen 30000;
  6.     server_name _;
  7.  
  8.     location / {
  9.         root /ramcache;
  10.         try_files $request_uri @proxy_origin;
  11.     }
  12.     location ~* \.(m3u8)$ {
  13.         proxy_cache off;
  14.         expires -1;
  15.         proxy_pass http://address:port;
  16.     }
  17.     location ~* \.(ts|trp)$ {
  18.         root /ramcache;
  19.         try_files $request_uri @proxy_origin;
  20.     }
  21.     location @proxy_origin {
  22.         resolver 8.8.8.8;
  23.         proxy_pass http://address:port;
  24.         proxy_temp_path "/ramcache/tmp";
  25.         proxy_store "/ramcache/$request_uri";
  26.         proxy_store_access user:rw group:rw all:r;
  27.         proxy_method GET;
  28.         proxy_set_header     Host $host;
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement