From 8eb6545fc3697f8e18179d7b0ea68067e43bc1c7 Mon Sep 17 00:00:00 2001 From: Rouven Seifert Date: Wed, 6 Sep 2023 14:22:56 +0200 Subject: [PATCH] nextcloud: add legacy redicect --- modules/nextcloud.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/nextcloud.nix b/modules/nextcloud.nix index b1dd2b4..ff5c191 100644 --- a/modules/nextcloud.nix +++ b/modules/nextcloud.nix @@ -1,6 +1,7 @@ { config, pkgs, lib, ... }: let domain = "nc.${config.fsr.domain}"; + legacy_domain = "oc.ifsr.de"; in { sops.secrets = { @@ -35,6 +36,11 @@ in enableACME = true; forceSSL = true; }; + nginx.virtualHosts.${legacy_domain} = { + enableACME = true; + forceSSL = true; + locations."/".return = "301 https://nc.ifsr.de"; + }; }; # ensure that postgres is running *before* running the setup