diff --git a/hosts/bekkalokk/services/well-known/default.nix b/hosts/bekkalokk/services/well-known/default.nix index a826c2d..e78c406 100644 --- a/hosts/bekkalokk/services/well-known/default.nix +++ b/hosts/bekkalokk/services/well-known/default.nix @@ -1,18 +1,25 @@ -{ ... }: +{ lib, ... }: { - services.nginx.virtualHosts."www.pvv.ntnu.no".locations = { - "^~ /.well-known/" = { - alias = (toString ./root) + "/"; - }; + services.nginx.virtualHosts = lib.genAttrs [ + "pvv.ntnu.no" + "www.pvv.ntnu.no" + "pvv.org" + "www.pvv.org" + ] (_: { + locations = { + "^~ /.well-known/" = { + alias = (toString ./root) + "/"; + }; - # Proxy the matrix well-known files - # Host has be set before proxy_pass - # The header must be set so nginx on the other side routes it to the right place - "^~ /.well-known/matrix/" = { - extraConfig = '' - proxy_set_header Host matrix.pvv.ntnu.no; - proxy_pass https://matrix.pvv.ntnu.no/.well-known/matrix/; - ''; + # Proxy the matrix well-known files + # Host has be set before proxy_pass + # The header must be set so nginx on the other side routes it to the right place + "^~ /.well-known/matrix/" = { + extraConfig = '' + proxy_set_header Host matrix.pvv.ntnu.no; + proxy_pass https://matrix.pvv.ntnu.no/.well-known/matrix/; + ''; + }; }; - }; + }); }