hostname parameter

This commit is contained in:
Vinzenz Schroeter 2024-03-02 13:54:39 +01:00
parent 84657bb2a8
commit 1cf414683b

View file

@ -4,7 +4,7 @@
... ...
}: let }: let
servicesDomain = "services.zerforschen.plus"; servicesDomain = "services.zerforschen.plus";
mkServiceConfig = port: { mkServiceConfig = host: port: {
addSSL = true; addSSL = true;
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
@ -15,9 +15,10 @@
auth_pam "Password Required"; auth_pam "Password Required";
auth_pam_service_name "nginx"; 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 { in {
imports = [ imports = [
(import ./modules { (import ./modules {
@ -59,10 +60,10 @@ in {
recommendedOptimisation = true; recommendedOptimisation = true;
virtualHosts = { virtualHosts = {
"preon-app.${servicesDomain}" = mkServiceConfig 8541; "preon-app.${servicesDomain}" = mkServiceConfig lpt2 8541;
"preon-api.${servicesDomain}" = mkServiceConfig 8542; "preon-api.${servicesDomain}" = mkServiceConfig lpt2 8542;
"vscode.${servicesDomain}" = lib.mkMerge [ "vscode.${servicesDomain}" = lib.mkMerge [
(mkServiceConfig 8543) (mkServiceConfig lpt2 8543)
{locations."/" .proxyWebsockets = true;} {locations."/" .proxyWebsockets = true;}
]; ];
}; };