diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 7d82aae..80a301e 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -77,9 +77,16 @@ http { proxy_set_header Host $host; } - ## The HLS stream location with thumbnails - ## Contains TS files, M3U8 files and PNG thumbnails - location ~ ^/stream/(.+)/(.+\.(ts|m3u8|png))$ { + ## Non cacheable HLS files, m3u8 and png + location ~ ^/stream/(.+)/(.+\.(m3u8|png))$ { + alias /user_data/$1/stream/$2; + + # Let the MPEG-TS video chunks be cacheable + expires -1d; + } + + ## Cacheable HLS files, ts + location ~ ^/stream/(.+)/(.+\.ts)$ { alias /user_data/$1/stream/$2; # Let the MPEG-TS video chunks be cacheable