changed cdn-urls

This commit is contained in:
Lukas Schulz 2020-11-28 19:16:13 +01:00
parent d4b8392763
commit 46d8907171

16
cdn.nix
View file

@ -34,7 +34,7 @@ cdn-node-setup = args@{ domain, config_file, ... }: {
basicAuth = basicAuthLogin; basicAuth = basicAuthLogin;
locations = { locations = {
"~* \\.(m3u8)$" = { "~* \\.(m3u8)$" = {
proxyPass = "https://cdn-master.lukas.studio$request_uri"; proxyPass = "https://cdn-master.live.hacc.media$request_uri";
extraConfig = '' extraConfig = ''
#proxy_cache = off; #proxy_cache = off;
@ -43,7 +43,7 @@ cdn-node-setup = args@{ domain, config_file, ... }: {
''; '';
}; };
"/hls" = { "/hls" = {
proxyPass = "https://cdn-master.lukas.studio$request_uri"; proxyPass = "https://cdn-master.live.hacc.media$request_uri";
extraConfig = '' extraConfig = ''
types { types {
application/vnd.apple.mpegurl m3u8; application/vnd.apple.mpegurl m3u8;
@ -254,8 +254,8 @@ cdn-loadbalancer-setup = args@{ domain, config_file, nodes, ... }: {
}; };
appendHttpConfig = '' appendHttpConfig = ''
split_clients "''\$''\{remote_addr''\}" $cdnhosts { split_clients "''\$''\{remote_addr''\}" $cdnhosts {
50% "cdn-node-1.lukas.studio"; 50% "cdn-node-1.live.hacc.media";
50% "cdn-node-2.lukas.studio"; 50% "cdn-node-2.live.hacc.media";
} }
''; '';
}; };
@ -274,20 +274,20 @@ in
#network.enableRollback = true; #network.enableRollback = true;
cdn-node-1 = cdn-node-setup { cdn-node-1 = cdn-node-setup {
domain="cdn-node-1.lukas.studio"; domain="cdn-node-1.live.hacc.media";
config_file="/Users/lukas/Documents/nixops/configuration-cdn-node-1.nix"; config_file="/Users/lukas/Documents/nixops/configuration-cdn-node-1.nix";
}; };
cdn-node-2 = cdn-node-setup { cdn-node-2 = cdn-node-setup {
domain="cdn-node-2.lukas.studio"; domain="cdn-node-2.live.hacc.media";
config_file="/Users/lukas/Documents/nixops/configuration-cdn-node-2.nix"; config_file="/Users/lukas/Documents/nixops/configuration-cdn-node-2.nix";
}; };
cdn-master = cdn-master-setup { cdn-master = cdn-master-setup {
domain="cdn-master.lukas.studio"; domain="cdn-master.live.hacc.media";
config_file="/Users/lukas/Documents/nixops/configuration-cdn-master.nix"; config_file="/Users/lukas/Documents/nixops/configuration-cdn-master.nix";
host-server = "https://rosenbaum.lukas.studio"; host-server = "https://rosenbaum.lukas.studio";
}; };
cdn-loadbalancer = cdn-loadbalancer-setup { cdn-loadbalancer = cdn-loadbalancer-setup {
domain="cdn-loadbalancer.lukas.studio"; domain="cdn-loadbalancer.live.hacc.media";
config_file="/Users/lukas/Documents/nixops/configuration-cdn-loadbalancer.nix"; config_file="/Users/lukas/Documents/nixops/configuration-cdn-loadbalancer.nix";
nodes= { nodes= {
# implement automatic node setting # implement automatic node setting