summaryrefslogtreecommitdiff
path: root/lib/nginx.nix
blob: bcf333216dcce98b781a45b420d63c1ead1145f8 (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}"
    );
}