summaryrefslogtreecommitdiff
path: root/lib/nginx.nix
blob: 0328f79e0ef29f5fedf58d7ac2497caebce5146c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
{lib, ...}: {
  mkProxy = endpoint: port: {
    "${endpoint}" = {
      proxyPass = "http://localhost:${toString port}";
      proxyWebsockets = true;
    };
  };

  toVHosts = domain:
    lib.mapAttrs' (
      name: value: lib.nameValuePair "${name}.${domain}" value
    );
}