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

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

    repositioned second CORS header

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

    escaped '

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

    repositioned cors header

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

    added cors header

commit bc30682b9e
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";
}
'';
};
}