forked from hacc/haccfiles
26 lines
526 B
Nix
26 lines
526 B
Nix
|
{config, lib, pkgs, ...}:
|
||
|
|
||
|
{
|
||
|
imports = [
|
||
|
./common.nix
|
||
|
];
|
||
|
services.nginx = {
|
||
|
virtualHosts."${config.networking.hostName}.live.hacc.media" = {
|
||
|
locations = {
|
||
|
"/" = {
|
||
|
return = "301 \"http://$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";
|
||
|
}
|
||
|
'';
|
||
|
};
|
||
|
}
|