haccfiles/services/shortdomains.nix
stuebinm 03ce987c90
shortcutdomains: 301 redirect -> 302 redirect
To prevent interference from indefinite caching of 301 redirects, this
now uses 302 redirects instead.
2021-10-07 17:50:54 +02:00

20 lines
413 B
Nix

{ config, lib, pkgs, ... }:
let
shortdomain = "i4f.de";
short = abbrv: target: {
name = "${abbrv}.${shortdomain}";
value = {
forceSSL = true;
enableACME = true;
locations."/".return = "302 https://${target}$request_uri";
};
};
in
{
services.nginx.virtualHosts = lib.listToAttrs [
(short "d" "discuss.infra4future.de")
(short "m" "mattermost.infra4future.de")
];
}