diff --git a/2.Common_services/5.Nginx/vhost_skyreach.conf b/2.Common_services/5.Nginx/vhost_skyreach.conf index d6f32ebade2f160fc65b8962ffd2ea4378782304..b8daaa02e574340c6bd2aba1148c208a2a826bec 100644 --- a/2.Common_services/5.Nginx/vhost_skyreach.conf +++ b/2.Common_services/5.Nginx/vhost_skyreach.conf @@ -45,6 +45,22 @@ server { proxy_read_timeout 12h; } + location /streaming/ { + # check requested path, only m3u8 and ts are allowed + # ?: means that the group should not be stored as variable + location ~ ^/streaming/([\d\.\:]+)/((?:.+)\.(?:m3u8|ts)(?:\?.+)*)$ { + proxy_pass https://$1/$2; + proxy_cache livecache; + # do not consider secure urls as new files + proxy_cache_key $scheme$proxy_host$uri; + # only one request at a time will be allowed to populate a new cache element + proxy_cache_lock on; + # show if playlist or fragment has been cached from wowza + add_header X-Cache $upstream_cache_status; + # wowza is defining expiration headers (m3u8 is 1s, ts is 3600) + } + } + location / { uwsgi_pass unix:///home/skyreach/.skyreach/uwsgi.sock; include /etc/nginx/uwsgi_params;