diff options
| -rw-r--r-- | hosts/atlas/nginx.nix | 26 | ||||
| -rw-r--r-- | hosts/p-body/nginx.nix | 28 |
2 files changed, 35 insertions, 19 deletions
diff --git a/hosts/atlas/nginx.nix b/hosts/atlas/nginx.nix index 1e2a349..2356e1d 100644 --- a/hosts/atlas/nginx.nix +++ b/hosts/atlas/nginx.nix @@ -20,20 +20,32 @@ recommendedTlsSettings = true; virtualHosts = let + inherit (config.networking) domain; + mkProxy = endpoint: port: { "${endpoint}" = { proxyPass = "http://localhost:${port}"; proxyWebsockets = true; }; }; - inherit (config.networking) domain; - in { - "miniflux.${domain}" = { - enableACME = true; - addSSL = true; - locations = mkProxy "/" "7000"; + mkVHosts = builtins.mapAttrs (_: v: + v + // { + enableACME = true; + # workaround for https://github.com/NixOS/nixpkgs/issues/210807 + acmeRoot = null; + forceSSL = true; + }); + in + mkVHosts { + "miniflux.${domain}" = { + locations = mkProxy "/" "7000"; + }; + + "msix.${domain}" = { + root = "/var/www/msix"; + }; }; - }; }; } diff --git a/hosts/p-body/nginx.nix b/hosts/p-body/nginx.nix index b2dae30..1d491d2 100644 --- a/hosts/p-body/nginx.nix +++ b/hosts/p-body/nginx.nix @@ -21,20 +21,24 @@ in { proxyWebsockets = true; }; }; - in { - "api.${domain}" = { - enableACME = true; - addSSL = true; - locations = mkProxy "/" "8080"; - }; - - "grafana.${domain}" = { - enableACME = true; - addSSL = true; + mkVHosts = builtins.mapAttrs (_: v: + v + // { + enableACME = true; + # workaround for https://github.com/NixOS/nixpkgs/issues/210807 + acmeRoot = null; + forceSSL = true; + }); + in + mkVHosts { + "api.${domain}" = { + locations = mkProxy "/" "8080"; + }; - locations = mkProxy "/" "4000"; + "grafana.${domain}" = { + locations = mkProxy "/" "4000"; + }; }; - }; }; } |
