Skip to content

Commit

Permalink
nixos/fedimintd: make nginx url forwarding path configurable (#347604)
Browse files Browse the repository at this point in the history
  • Loading branch information
h7x4 authored Oct 10, 2024
2 parents 9a34180 + 570454c commit e49f357
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions nixos/modules/services/networking/fedimintd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
'';
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 = ''
Expand Down

0 comments on commit e49f357

Please sign in to comment.