server {
  listen 8080;
  server_name _;

  root /usr/share/nginx/html;
  autoindex on;

  # Content types
  types {
    application/json json;

    image/jpeg jpg jpeg;
    image/png  png;
    image/webp webp;
    image/gif  gif;

    audio/mpeg mp3;
    audio/ogg  ogg;
    audio/mp4  m4a;
  }

  # JSON ska aldrig cacheas (mycket viktigt för playlist.json)
  location ~* \.json$ {
    add_header Access-Control-Allow-Origin "*" always;
    add_header Cache-Control "no-cache" always;
    try_files $uri =404;
  }

  # Allt annat (mp3, bilder etc)
  location / {
    add_header Access-Control-Allow-Origin "*" always;
    add_header Cache-Control "public, max-age=31536000, immutable" always;
    try_files $uri $uri/ =404;
  }
}