From 1706bf5a394ffbe9a7a9ee5cc1fb049aa8a45a19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Diemer?= <stephane.diemer@ubicast.eu> Date: Wed, 25 Jan 2017 18:33:42 +0100 Subject: [PATCH] Updated streaming vhost. --- 6.Nginx/vhost_streaming.conf | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/6.Nginx/vhost_streaming.conf b/6.Nginx/vhost_streaming.conf index 1dac0878..c2f6ce3f 100644 --- a/6.Nginx/vhost_streaming.conf +++ b/6.Nginx/vhost_streaming.conf @@ -19,15 +19,33 @@ server { } location / { + location ~ \.m3u8$ { + rewrite ^/(.*)$ /$1? break; + proxy_pass http://localhost:1935; + add_header Access-Control-Allow-Origin "*"; + add_header X-Cache $upstream_cache_status; + expires -1; + proxy_cache livecache; + proxy_cache_key $scheme$proxy_host$uri; + proxy_cache_lock on; + proxy_cache_min_uses 1; + proxy_cache_use_stale updating; + proxy_cache_valid 200 1s; + } + location ~ \.ts$ { + rewrite ^/(.*)$ /$1? break; + proxy_pass http://localhost:1935; + add_header Access-Control-Allow-Origin "*"; + add_header X-Cache $upstream_cache_status; + expires 2s; + proxy_cache livecache; + proxy_cache_key $scheme$proxy_host$uri; + proxy_cache_lock on; + proxy_cache_min_uses 1; + proxy_cache_valid 200 10s; + } + # only urls to ts and m3u8 files are allowed, discard any requested path for other urls + rewrite ^/(.*)$ /? break; proxy_pass http://localhost:1935/; - proxy_cache cache; - proxy_cache_lock on; - expires 2s; - proxy_cache_use_stale updating; - proxy_cache_min_uses 1; - proxy_cache_valid 200 2s; - add_header X-Proxy-Cache $upstream_cache_status; - add_header X-Cache $upstream_cache_status; - add_header Access-Control-Allow-Origin "*"; } } -- GitLab