diff options
| author | Caroline Larimore <caroline@larimo.re> | 2024-07-20 17:50:59 -0700 |
|---|---|---|
| committer | Caroline Larimore <caroline@larimo.re> | 2024-07-20 17:50:59 -0700 |
| commit | ad70a6505bb3f052c6a0161ae0d2010c654737b3 (patch) | |
| tree | e3c315552a0d002164a45e38c3dfceed4bc0eda5 /roles/web/proxy/default.nix | |
| parent | 036e6e8d3959f9490bd54819a5efe574306b4b6f (diff) | |
Rework web roles
Diffstat (limited to 'roles/web/proxy/default.nix')
| -rw-r--r-- | roles/web/proxy/default.nix | 25 |
1 files changed, 17 insertions, 8 deletions
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/"; + }; }; }; }; |