From 570454c2954243d624b2e29854ed076ae161a049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ci=C4=99=C5=BCarkiewicz?= Date: Wed, 9 Oct 2024 14:24:06 -0700 Subject: [PATCH] nixos/fedimintd: make nginx url forwarding path configurable Some users would like to customize it. Also, in current versions of fedimint p2p port in the URL must be set, due to some bug, so update the example value to reflect that. --- nixos/modules/services/networking/fedimintd.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/networking/fedimintd.nix b/nixos/modules/services/networking/fedimintd.nix index 1ede3a50553d..c7d93854e21a 100644 --- a/nixos/modules/services/networking/fedimintd.nix +++ b/nixos/modules/services/networking/fedimintd.nix @@ -63,7 +63,7 @@ let }; url = mkOption { type = types.str; - example = "fedimint://p2p.myfedimint.com"; + example = "fedimint://p2p.myfedimint.com:8173"; description = '' Public address for p2p connections from peers ''; @@ -159,6 +159,12 @@ let example = "api.myfedimint.com"; description = "Public domain of the API address of the reverse proxy/tls terminator."; }; + path = mkOption { + type = types.str; + example = "/"; + default = "/ws/"; + description = "Path to host the API on and forward to the daemon's api port"; + }; config = mkOption { type = types.submodule ( recursiveUpdate (import ../web-servers/nginx/vhost-options.nix { @@ -286,8 +292,7 @@ in # overriden by default value from vhost-options.nix enableACME = mkOverride 99 true; forceSSL = mkOverride 99 true; - # Currently Fedimint API only support JsonRPC on `/ws/` endpoint, so no need to handle `/` - locations."/ws/" = { + locations.${cfg.nginx.path} = { proxyPass = "http://127.0.0.1:${toString cfg.api.port}/"; proxyWebsockets = true; extraConfig = ''