refactor(reverse-proxy): use route registry

This commit is contained in:
2026-08-23 23:44:22 -04:00
parent c267a2ec5c
commit 7f6d3b295e
9 changed files with 186 additions and 235 deletions

View File

@@ -2,7 +2,6 @@
config,
lib,
my,
reverseProxyFleetRoutes ? config.modules.reverse-proxy.routes,
...
}:
let
@@ -18,12 +17,13 @@ let
"todo.alexion.dev"
"wings.alexion.dev"
];
legacyRoutes = lib.listToAttrs (
legacyVirtualHosts = lib.listToAttrs (
map (host: {
name = "legacy-${lib.replaceStrings [ "." ] [ "-" ] host}";
name = host;
value = {
inherit host;
backend = legacyBackend;
forceSSL = true;
enableACME = true;
locations."/".proxyPass = legacyBackend;
};
}) legacyHosts
);
@@ -33,10 +33,9 @@ in
(my.guest {
name = "reverse-proxy";
interior = {
modules.reverse-proxy = {
enable = true;
routes = reverseProxyFleetRoutes // legacyRoutes;
};
modules.reverse-proxy.enable = true;
services.nginx.virtualHosts = legacyVirtualHosts;
networking.firewall.allowedTCPPorts = [ 2022 ];