server { listen 80; server_name localhost; # Where your assets live root /usr/share/nginx/html; index index.html; # ---------- Default site (HTML/CSS/JS) ---------- location / { try_files $uri $uri/ =404; } # ---------- 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; # 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; } }