summaryrefslogtreecommitdiff
path: root/parts/lib/utils/nginx.nix
blob: 57be4fb813b63c795ab18561f8d2fbe8554cd203 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{lib, ...}: let
  inherit (builtins) mapAttrs;
  inherit (lib) recursiveUpdate;
in {
  mkProxy = endpoint: port: {
    "${endpoint}" = {
      proxyPass = "http://localhost:${toString port}";
      proxyWebsockets = true;
    };
  };

  mkVHosts = let
    commonSettings = {
      enableACME = true;
      # workaround for https://github.com/NixOS/nixpkgs/issues/210807
      acmeRoot = null;

      addSSL = true;
    };
  in
    mapAttrs (_: recursiveUpdate commonSettings);
}