diff --git a/nginx/conf.d/default.conf b/nginx/conf.d/default.conf index 4bb9a97..c67b44e 100644 --- a/nginx/conf.d/default.conf +++ b/nginx/conf.d/default.conf @@ -2,24 +2,30 @@ server { listen 80; server_name localhost; + # Where your assets live root /usr/share/nginx/html; index index.html; - # --- STATIC WEB UI ------------------------------------------------------- + # ---------- Default site (HTML/CSS/JS) ---------- location / { try_files $uri $uri/ =404; } - # --- MEDIA FILES --------------------------------------------------------- - # Anything with audio-ish extension gets correct MIME + long-term caching. - location ~ \.(opus|ogg|mp3|flac|wav)$ { - # 30-day client cache, tweak at will + # ---------- Audio (and optional video) ---------- + # 30-day cache; adjust max-age as needed. + location ~ \.(opus|ogg|mp3|flac|wav|m4a|aac|mp4|webm)$ { add_header Cache-Control "public, max-age=2592000" always; - # nginx:1.27 doesn’t know .opus by default → teach it: - types { audio/opus opus; } + # Teach Nginx any MIME types it doesn’t already know: + types { + audio/opus opus; + audio/mpeg mp3; + audio/mp4 m4a; + audio/aac aac; + video/mp4 mp4; + video/webm webm; + } try_files $uri =404; - } } }