mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 10:02:36 +09:00
nixos/fedimintd: make nginx url forwarding path configurable (#347604)
This commit is contained in:
commit
e49f3574ab
1 changed files with 8 additions and 3 deletions
|
@ -63,7 +63,7 @@ let
|
||||||
};
|
};
|
||||||
url = mkOption {
|
url = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
example = "fedimint://p2p.myfedimint.com";
|
example = "fedimint://p2p.myfedimint.com:8173";
|
||||||
description = ''
|
description = ''
|
||||||
Public address for p2p connections from peers
|
Public address for p2p connections from peers
|
||||||
'';
|
'';
|
||||||
|
@ -159,6 +159,12 @@ let
|
||||||
example = "api.myfedimint.com";
|
example = "api.myfedimint.com";
|
||||||
description = "Public domain of the API address of the reverse proxy/tls terminator.";
|
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 {
|
config = mkOption {
|
||||||
type = types.submodule (
|
type = types.submodule (
|
||||||
recursiveUpdate (import ../web-servers/nginx/vhost-options.nix {
|
recursiveUpdate (import ../web-servers/nginx/vhost-options.nix {
|
||||||
|
@ -286,8 +292,7 @@ in
|
||||||
# overriden by default value from vhost-options.nix
|
# overriden by default value from vhost-options.nix
|
||||||
enableACME = mkOverride 99 true;
|
enableACME = mkOverride 99 true;
|
||||||
forceSSL = mkOverride 99 true;
|
forceSSL = mkOverride 99 true;
|
||||||
# Currently Fedimint API only support JsonRPC on `/ws/` endpoint, so no need to handle `/`
|
locations.${cfg.nginx.path} = {
|
||||||
locations."/ws/" = {
|
|
||||||
proxyPass = "http://127.0.0.1:${toString cfg.api.port}/";
|
proxyPass = "http://127.0.0.1:${toString cfg.api.port}/";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue