haccfiles/configuration/server/cdn/cdn-lb.nix
hexchen cafbe5bb79 livecdn: add CORS
close !6

commit 77ed77aa9358096e4bbd7f8d7fda0ffcfcc67334
Author: Lukas Schulz <lukas.schulz@simiworld.de>
Date:   Tue Dec 1 21:33:13 2020 +0100

    repositioned second CORS header

commit fe01c721a6fa6d7b9e257d23e077703b3c6f5028
Author: Lukas Schulz <lukas.schulz@simiworld.de>
Date:   Tue Dec 1 21:32:36 2020 +0100

    escaped '

commit 6b50ef9de5f042d1f4f26804440b68019257b0d6
Author: Lukas Schulz <lukas.schulz@simiworld.de>
Date:   Tue Dec 1 21:28:24 2020 +0100

    repositioned cors header

commit cdaad1a973c5040a64418b133889866673d6b0d5
Author: Lukas Schulz <lukas.schulz@simiworld.de>
Date:   Tue Dec 1 21:25:29 2020 +0100

    added cors header

commit bc30682b9e53bc33ba00e164870b7ca7fbc9fb9e
Author: Lukas Schulz <lukas.schulz@simiworld.de>
Date:   Tue Dec 1 21:21:15 2020 +0100

    changed cdn-url to https to fix mixed content stuff

Signed-off-by: hexchen <hexchen@lilwit.ch>
2020-12-01 20:37:02 +00:00

25 lines
527 B
Nix

{config, lib, pkgs, ...}:
{
imports = [
./common.nix
];
services.nginx = {
virtualHosts."${config.networking.hostName}.live.hacc.media" = {
locations = {
"/" = {
return = "301 \"https://$cdnhosts$request_uri\"";
extraConfig = ''
auth_basic off;
'';
};
};
};
appendHttpConfig = ''
split_clients "$remote_addr" $cdnhosts {
50% "cdn-node-1.live.hacc.media";
50% "cdn-node-2.live.hacc.media";
}
'';
};
}