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"; }