Options -Indexes
DirectoryIndex index.html

AddType application/vnd.apple.mpegurl .m3u .m3u8
AddType application/json .json
AddDefaultCharset UTF-8

<IfModule mod_headers.c>
  Header always set X-Content-Type-Options "nosniff"
  Header always set Referrer-Policy "strict-origin-when-cross-origin"
  Header always set X-Frame-Options "SAMEORIGIN"
  Header always set Permissions-Policy "camera=(), microphone=(), geolocation=()"
  <FilesMatch "\.(m3u|m3u8|json|txt)$">
    Header set Access-Control-Allow-Origin "*"
  </FilesMatch>
  <FilesMatch "\.(css|js|png|webp|jpg|jpeg|gif|svg)$">
    Header set Cache-Control "public, max-age=604800"
  </FilesMatch>
  <FilesMatch "\.(m3u|m3u8|json|txt)$">
    Header set Cache-Control "public, max-age=300"
  </FilesMatch>
</IfModule>

<FilesMatch "(^\.|\.(py|pyc|yml|yaml|ini|env|log|sh|bat|ps1|sql)$)">
  <IfModule mod_authz_core.c>
    Require all denied
  </IfModule>
  <IfModule !mod_authz_core.c>
    Deny from all
  </IfModule>
</FilesMatch>
