From 33a24888693f66af9e229fc6741b7223c2823958 Mon Sep 17 00:00:00 2001 From: TheMaddax Date: Mon, 9 Dec 2024 18:20:06 -0600 Subject: [PATCH] Update to add for videos --- nginx.conf | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index 936f441..abaaccc 100644 --- a/nginx.conf +++ b/nginx.conf @@ -9,7 +9,7 @@ server { add_header X-XSS-Protection "1; mode=block"; add_header X-Content-Type-Options "nosniff"; add_header Strict-Transport-Security "max-age=31536000"; - add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://unpkg.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:;"; + add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://unpkg.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; media-src 'self';"; # Compression gzip on; @@ -21,8 +21,18 @@ server { add_header Cache-Control "public, no-transform"; } + # Video files handling + location /videos/ { + alias /usr/share/nginx/html/videos/; + add_header Cache-Control "public, no-transform"; + types { + video/mp4 mp4; + } + add_header Accept-Ranges bytes; + } + # Static asset caching - location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|vtt|txt)$ { expires 30d; add_header Cache-Control "public, no-transform"; }