From d9912da7df0b22806cdf8fbe684a67c5a52914fd Mon Sep 17 00:00:00 2001 From: Ethel Morgan Date: Sat, 11 Jul 2020 13:39:11 +0100 Subject: add more sites.* nginx convenience functions --- nixos/sites/default.nix | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'nixos/sites/default.nix') diff --git a/nixos/sites/default.nix b/nixos/sites/default.nix index 1ddd148..95d8055 100644 --- a/nixos/sites/default.nix +++ b/nixos/sites/default.nix @@ -1,10 +1,34 @@ { pkgs, ... }: { + catbus-web-ui = pkgs.callPackage ./catbus-web-ui.nix {}; + https = site: site // { forceSSL = true; enableACME = true; }; - catbus-web-ui = pkgs.callPackage ./catbus-web-ui.nix {}; + static = root: { + locations = { + "/" = { + root = root; + }; + }; + }; + + proxyACME = remoteHost: { + locations = { + "/.well-known/acme-challenge/" = { + proxyPass = "http://${remoteHost}"; + }; + }; + }; + + proxySocket = socketPath: { + locations = { + "/" = { + proxyPass = "http://unix:/${socketPath}"; + }; + }; + }; } -- cgit v1.2.3