diff --git a/hosts/parsons/configuration.nix b/hosts/parsons/configuration.nix index fb75f26..0051054 100644 --- a/hosts/parsons/configuration.nix +++ b/hosts/parsons/configuration.nix @@ -22,6 +22,7 @@ ../../services/unifi.nix ../../services/lantifa.nix ../../services/vaultwarden.nix + ../../services/shortdomains.nix ./lxc.nix ]; diff --git a/services/shortdomains.nix b/services/shortdomains.nix new file mode 100644 index 0000000..2f24d8c --- /dev/null +++ b/services/shortdomains.nix @@ -0,0 +1,19 @@ +{ config, lib, pkgs, ... }: + +let + shortdomain = "i4f.de"; + short = abbrv: target: { + name = "${abbrv}.${shortdomain}"; + value = { + forceSSL = true; + enableACME = true; + locations."/".return = "301 https://${target}$request_uri"; + }; + }; +in +{ + services.nginx.virtualHosts = lib.listToAttrs [ + (short "d" "discuss.infra4future.de") + (short "m" "mattermost.infra4future.de") + ]; +}