From 1cf414683be4c239995c77cf8425d4c05d1eb109 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 2 Mar 2024 13:54:39 +0100 Subject: [PATCH] hostname parameter --- hetzner-vpn1.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix index 5a3f648..f6c355e 100644 --- a/hetzner-vpn1.nix +++ b/hetzner-vpn1.nix @@ -4,7 +4,7 @@ ... }: let servicesDomain = "services.zerforschen.plus"; - mkServiceConfig = port: { + mkServiceConfig = host: port: { addSSL = true; enableACME = true; locations."/" = { @@ -15,9 +15,10 @@ auth_pam "Password Required"; auth_pam_service_name "nginx"; ''; - proxyPass = "http://vinzenz-lpt2.donkey-pentatonic.ts.net:${toString port}/"; + proxyPass = "http://${host}:${toString port}/"; }; }; + lpt2 = "vinzenz-lpt2.donkey-pentatonic.ts.net"; in { imports = [ (import ./modules { @@ -59,10 +60,10 @@ in { recommendedOptimisation = true; virtualHosts = { - "preon-app.${servicesDomain}" = mkServiceConfig 8541; - "preon-api.${servicesDomain}" = mkServiceConfig 8542; + "preon-app.${servicesDomain}" = mkServiceConfig lpt2 8541; + "preon-api.${servicesDomain}" = mkServiceConfig lpt2 8542; "vscode.${servicesDomain}" = lib.mkMerge [ - (mkServiceConfig 8543) + (mkServiceConfig lpt2 8543) {locations."/" .proxyWebsockets = true;} ]; };