From cafbe5bb79536d5dd85c93b828ecfac8761fcc2e Mon Sep 17 00:00:00 2001 From: hexchen Date: Tue, 1 Dec 2020 20:37:02 +0000 Subject: [PATCH] livecdn: add CORS close !6 commit 77ed77aa9358096e4bbd7f8d7fda0ffcfcc67334 Author: Lukas Schulz Date: Tue Dec 1 21:33:13 2020 +0100 repositioned second CORS header commit fe01c721a6fa6d7b9e257d23e077703b3c6f5028 Author: Lukas Schulz Date: Tue Dec 1 21:32:36 2020 +0100 escaped ' commit 6b50ef9de5f042d1f4f26804440b68019257b0d6 Author: Lukas Schulz Date: Tue Dec 1 21:28:24 2020 +0100 repositioned cors header commit cdaad1a973c5040a64418b133889866673d6b0d5 Author: Lukas Schulz Date: Tue Dec 1 21:25:29 2020 +0100 added cors header commit bc30682b9e53bc33ba00e164870b7ca7fbc9fb9e Author: Lukas Schulz Date: Tue Dec 1 21:21:15 2020 +0100 changed cdn-url to https to fix mixed content stuff Signed-off-by: hexchen --- configuration/server/cdn/cdn-lb.nix | 2 +- configuration/server/cdn/cdn-master.nix | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/configuration/server/cdn/cdn-lb.nix b/configuration/server/cdn/cdn-lb.nix index f717ba6..d6f79da 100644 --- a/configuration/server/cdn/cdn-lb.nix +++ b/configuration/server/cdn/cdn-lb.nix @@ -8,7 +8,7 @@ virtualHosts."${config.networking.hostName}.live.hacc.media" = { locations = { "/" = { - return = "301 \"http://$cdnhosts$request_uri\""; + return = "301 \"https://$cdnhosts$request_uri\""; extraConfig = '' auth_basic off; ''; diff --git a/configuration/server/cdn/cdn-master.nix b/configuration/server/cdn/cdn-master.nix index 14e866c..dde85bf 100644 --- a/configuration/server/cdn/cdn-master.nix +++ b/configuration/server/cdn/cdn-master.nix @@ -10,14 +10,17 @@ in { virtualHosts."${config.networking.hostName}.live.hacc.media" = { locations = { "~* \\.(m3u8)$" = { + proxyPass = "${host-server}$request_uri"; extraConfig = '' #proxy_cache = off; expires 2s; auth_basic off; + add_header 'Access-Control-Allow-Origin' '*'; ''; }; "/hls" = { + proxyPass = "${host-server}$request_uri"; extraConfig = '' types { @@ -28,6 +31,7 @@ in { proxy_ignore_headers Cache-Control; proxy_cache_valid any 30m; auth_basic off; + add_header 'Access-Control-Allow-Origin' '*'; ''; }; };