nixos-config/machines/okarin/services/proxy.nix
2023-05-06 11:39:31 +02:00

23 lines
456 B
Nix

{ lib, ... }:
let
proxyMap = {
"sbruder.xyz" = "renge";
"nitter.sbruder.xyz" = "renge";
"iv.sbruder.xyz" = "renge";
"libreddit.sbruder.xyz" = "renge";
};
in
{
services.nginx.virtualHosts = lib.mapAttrs
(host: target: {
enableACME = true;
forceSSL = true;
locations."/".extraConfig = ''
proxy_pass http://${target}.vpn.sbruder.de/;
proxy_set_header Host ${host};
'';
})
proxyMap;
}