VEGAS/cdn-shield: init
This commit is contained in:
parent
95d88f9a15
commit
b8442d4763
4 changed files with 29 additions and 0 deletions
11
hosts/VEGAS/services/cdn-shield/default.nix
Normal file
11
hosts/VEGAS/services/cdn-shield/default.nix
Normal 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; });
|
||||||
|
}
|
7
hosts/VEGAS/services/cdn-shield/shields.nix
Normal file
7
hosts/VEGAS/services/cdn-shield/shields.nix
Normal 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";
|
||||||
|
}
|
|
@ -17,6 +17,7 @@
|
||||||
# Services
|
# Services
|
||||||
./services/backbone-routing
|
./services/backbone-routing
|
||||||
./services/bitwarden
|
./services/bitwarden
|
||||||
|
./services/cdn-shield
|
||||||
./services/dns
|
./services/dns
|
||||||
./services/fbi
|
./services/fbi
|
||||||
./services/bitwarden
|
./services/bitwarden
|
||||||
|
|
|
@ -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;
|
}) tools;
|
||||||
in tools
|
in tools
|
||||||
|
|
Loading…
Reference in a new issue