aboutsummaryrefslogtreecommitdiff
path: root/modules/network/service-router.service.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/network/service-router.service.nix')
-rw-r--r--modules/network/service-router.service.nix4
1 files changed, 3 insertions, 1 deletions
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;