From ad70a6505bb3f052c6a0161ae0d2010c654737b3 Mon Sep 17 00:00:00 2001 From: Caroline Larimore Date: Sat, 20 Jul 2024 17:50:59 -0700 Subject: Rework web roles --- roles/web/proxy/default.nix | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'roles/web/proxy/default.nix') diff --git a/roles/web/proxy/default.nix b/roles/web/proxy/default.nix index 879ef12..3f06265 100644 --- a/roles/web/proxy/default.nix +++ b/roles/web/proxy/default.nix @@ -4,6 +4,11 @@ with lib; let cfg = config.roles.web.proxy; in { options.roles.web.proxy = { enable = mkEnableOption "nginx reverse proxy"; + personal = mkOption { + type = types.str; + default = "localhost:8080"; + description = "personal site address"; + }; }; config = mkIf cfg.enable { @@ -12,14 +17,18 @@ let cfg = config.roles.web.proxy; in { services.nginx = { enable = true; virtualHosts = { - "localhost".locations = { - "/test" = { - recommendedProxySettings = true; - proxyPass = "http://192.168.0.2/"; - }; - "/stargazers" = { - recommendedProxySettings = true; - proxyPass = "http://192.168.0.3/"; + "caroline.larimo.re" = { + serverAliases = [ "cxl.sh" "localhost" ]; + + locations = { + "/" = { + recommendedProxySettings = true; + proxyPass = "http://${cfg.personal}/"; + }; + "/test" = { + recommendedProxySettings = true; + proxyPass = "http://web-test.containers/"; + }; }; }; }; -- cgit v1.2.3