{config, lib, pkgs, ...}: { imports = [ ./common.nix ]; # Enable nginx service services.nginx = { virtualHosts."${config.networking.hostName}.live.hacc.media" = { forceSSL = true; enableACME = true; # basicAuth = basicAuthLogin; locations = { "~* \\.(m3u8)$" = { proxyPass = "https://cdn-master.live.hacc.media$request_uri"; extraConfig = '' #proxy_cache = off; expires 3s; auth_basic off; ''; }; "/hls" = { proxyPass = "https://cdn-master.live.hacc.media$request_uri"; extraConfig = '' types { application/vnd.apple.mpegurl m3u8; video/mp2t ts; } proxy_cache hls; proxy_ignore_headers Cache-Control; proxy_cache_valid any 30m; auth_basic off; ''; }; }; }; appendHttpConfig = '' proxy_cache_path /tmp keys_zone=hls:10m max_size=10g inactive=60m use_temp_path=on; resolver 1.1.1.1; ''; }; }