From 091dc5b83539f3fa5efdbda09c9bcecc7b76395e Mon Sep 17 00:00:00 2001 From: ThisBirchWood Date: Sun, 2 Mar 2025 16:24:06 +0000 Subject: [PATCH] PATCH: Adjusted NGINX config to make m3u8 and png files uncacheable --- nginx/nginx.conf | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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