diff options
Diffstat (limited to 'lib')
| -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 + ); +} |
