diff options
Diffstat (limited to 'etc/nginx')
| -rw-r--r-- | etc/nginx/nginx.conf | 1 | ||||
| -rw-r--r-- | etc/nginx/sites-available/yummers.dev | 15 |
2 files changed, 12 insertions, 4 deletions
diff --git a/etc/nginx/nginx.conf b/etc/nginx/nginx.conf index 763c968..ab7aff4 100644 --- a/etc/nginx/nginx.conf +++ b/etc/nginx/nginx.conf @@ -6,7 +6,6 @@ include /etc/nginx/modules-enabled/*.conf; events { worker_connections 768; - # multi_accept on; } http { diff --git a/etc/nginx/sites-available/yummers.dev b/etc/nginx/sites-available/yummers.dev index bb5bbc5..c1162a6 100644 --- a/etc/nginx/sites-available/yummers.dev +++ b/etc/nginx/sites-available/yummers.dev @@ -43,10 +43,19 @@ server { limit_req zone=hls_limit burst=200 nodelay; alias /var/www/streams/live/; - - add_header Cache-Control "no-cache" always; add_header Access-Control-Allow-Origin "*" always; - expires -1; + + # Playlist files (.m3u8) should not be cached - they change constantly + location ~ \.m3u8$ { + add_header Cache-Control "no-cache, no-store, must-revalidate" always; + add_header Access-Control-Allow-Origin "*" always; + } + + # Segment files (.ts) can be cached - they're immutable + location ~ \.ts$ { + add_header Cache-Control "public, max-age=30" always; + add_header Access-Control-Allow-Origin "*" always; + } autoindex off; limit_except GET HEAD { |
