summaryrefslogtreecommitdiff
path: root/lib/nginx.nix
blob: 1b1c951b630676343cf7ccd0cc9cd30f9d044aa4 (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: lib.nameValuePair "${name}.${domain}"
    );
}