From ac05391c228b1630614e6585124f183a90489414 Mon Sep 17 00:00:00 2001 From: seth Date: Thu, 8 Feb 2024 21:20:51 -0500 Subject: lib/nginx: init --- lib/nginx.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 lib/nginx.nix (limited to 'lib') 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 + ); +} -- cgit v1.2.3