diff options
| author | seth <[email protected]> | 2024-02-08 21:20:51 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2024-02-09 01:17:16 -0500 |
| commit | ac05391c228b1630614e6585124f183a90489414 (patch) | |
| tree | e24244485f9f5cd5e9549126677bec38dd676115 /lib/nginx.nix | |
| parent | 98e9edac4c79a6f4f723db9df79adf99ac3ffb51 (diff) | |
lib/nginx: init
Diffstat (limited to 'lib/nginx.nix')
| -rw-r--r-- | lib/nginx.nix | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/nginx.nix b/lib/nginx.nix new file mode 100644 index 0000000..0328f79 --- /dev/null +++ b/lib/nginx.nix @@ -0,0 +1,13 @@ +{lib, ...}: { + mkProxy = endpoint: port: { + "${endpoint}" = { + proxyPass = "http://localhost:${toString port}"; + proxyWebsockets = true; + }; + }; + + toVHosts = domain: + lib.mapAttrs' ( + name: value: lib.nameValuePair "${name}.${domain}" value + ); +} |
