VEGAS/cdn-shield: init

This commit is contained in:
Max Headroom 2021-10-16 15:07:53 +02:00
parent 95d88f9a15
commit b8442d4763
4 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,11 @@
{ config, lib, toolsets, ... }:
let
tools = toolsets.nginx {
inherit lib config;
domain = "cdn-shield.${toolsets.meta.domain}";
};
in
{
services.nginx.virtualHosts = tools.mappers.mapSubdomains (import ./shields.nix { inherit tools; });
}

View file

@ -0,0 +1,7 @@
{ tools }:
with tools.vhosts;
{
"fonts-googleapis-com" = proxyGhost "https" "fonts.googleapis.com";
"fonts-gstatic-com" = proxyGhost "https" "fonts.gstatic.com";
"cdnjs-cloudflare-com" = proxyGhost "https" "cdnjs.cloudflare.com";
}

View file

@ -17,6 +17,7 @@
# Services
./services/backbone-routing
./services/bitwarden
./services/cdn-shield
./services/dns
./services/fbi
./services/bitwarden

View file

@ -43,6 +43,16 @@ let
'';
};
proxyGhost = scheme: target: basic // {
locations."/".extraConfig = ''
proxy_pass ${scheme}://${target};
proxy_set_header Host ${target};
proxy_set_header Referer ${scheme}://${target};
proxy_cookie_domain ${target} domain.invalid;
proxy_set_header Cookie "";
'';
};
};
}) tools;
in tools