2020-11-29 12:54:35 +00:00
|
|
|
{config, lib, pkgs, ...}:
|
|
|
|
|
|
|
|
let
|
|
|
|
host-server = "https://rosenbaum.lukas.studio";
|
|
|
|
in {
|
|
|
|
imports = [
|
|
|
|
./common.nix
|
|
|
|
];
|
|
|
|
services.nginx = {
|
|
|
|
virtualHosts."${config.networking.hostName}.live.hacc.media" = {
|
|
|
|
locations = {
|
|
|
|
"~* \\.(m3u8)$" = {
|
2020-12-01 20:37:02 +00:00
|
|
|
|
2020-11-29 12:54:35 +00:00
|
|
|
proxyPass = "${host-server}$request_uri";
|
|
|
|
extraConfig = ''
|
|
|
|
#proxy_cache = off;
|
|
|
|
expires 2s;
|
|
|
|
auth_basic off;
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
"/hls" = {
|
2020-12-01 20:37:02 +00:00
|
|
|
|
2020-11-29 12:54:35 +00:00
|
|
|
proxyPass = "${host-server}$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;
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|