diff options
Diffstat (limited to '')
| -rw-r--r-- | modules/network/default.nix | 1 | ||||
| -rw-r--r-- | modules/network/service-router.service.nix | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/modules/network/default.nix b/modules/network/default.nix index 6a40ef7..53e64b0 100644 --- a/modules/network/default.nix +++ b/modules/network/default.nix @@ -20,6 +20,7 @@ in "jellyfin.local" = { inherit host; port = ports.jellyfin; }; "syncthing.local" = { inherit host; port = ports.syncthing; }; "lidarr.local" = { inherit host; port = ports.lidarr; }; + "git.local" = { inherit host; port = 80; basePath = "/gitweb/"; }; }; }; diff --git a/modules/network/service-router.service.nix b/modules/network/service-router.service.nix index 9c4e6e2..3d0b6e7 100644 --- a/modules/network/service-router.service.nix +++ b/modules/network/service-router.service.nix @@ -19,6 +19,7 @@ in { port = mkOption { type = types.int; }; host = mkOption { type = types.str; default = "127.0.0.1"; }; protocol = mkOption { type = types.str; default = "http"; }; + basePath = mkOption { type = types.str; default = ""; }; nginx = mkOption { type = types.attrs; default = {}; }; }; }); default = {}; @@ -31,7 +32,8 @@ in { recommendedOptimisation = true; virtualHosts = lib.mapAttrs (_: val: { locations."/" = if val.nginx == {} then { - proxyPass = "${val.protocol}://${val.host}:${toString val.port}"; + proxyPass = + "${val.protocol}://${val.host}:${toString val.port}${val.basePath}"; proxyWebsockets = true; } else val.nginx; }) cfg.routes; |
