From cb20d078360ec9235b9b3a78d7950ded1f601267 Mon Sep 17 00:00:00 2001 From: Emile Date: Tue, 26 Mar 2024 10:30:12 +0100 Subject: ports.nix file containing the used ports in a central location Done and deployed in the 15min train ride to the office, quick and easy! --- nix/hosts/corrino/modules/authelia.emile.space.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'nix/hosts/corrino/modules') diff --git a/nix/hosts/corrino/modules/authelia.emile.space.nix b/nix/hosts/corrino/modules/authelia.emile.space.nix index 774e62f..8a2c62a 100644 --- a/nix/hosts/corrino/modules/authelia.emile.space.nix +++ b/nix/hosts/corrino/modules/authelia.emile.space.nix @@ -1,6 +1,9 @@ { config, pkgs, ... }: -{ +let + ports = import ../ports.nix; + authelia_port = config.services.authelia.instances.main.settings.server.port; +in { services.nginx.virtualHosts."sso.emile.space" = { forceSSL = true; @@ -8,7 +11,7 @@ locations = { "/" = { - proxyPass = "http://127.0.0.1:9091"; + proxyPass = "http://127.0.0.1:${toString authelia_port}"; extraConfig = '' ## Headers @@ -50,11 +53,11 @@ }; "/api/verify" = { - proxyPass = "http://127.0.0.1:9091"; + proxyPass = "http://127.0.0.1:${toString authelia_port}"; }; "/api/authz/" = { - proxyPass = "http://127.0.0.1:9091"; + proxyPass = "http://127.0.0.1:${toString authelia_port}"; }; }; }; @@ -103,7 +106,7 @@ server = { host = "127.0.0.1"; - port = 9091; + port = ports.authelia; }; # we're using a file to store the user information -- cgit 1.4.1