From 3fae1f6d4e5cc27bf9582323f053af00188b94d1 Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Mon, 27 Nov 2023 20:31:19 +0100 Subject: [PATCH] Redirect subpages like ./well-known, add @-domains --- hosts/bekkalokk/services/nginx/ingress.nix | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/hosts/bekkalokk/services/nginx/ingress.nix b/hosts/bekkalokk/services/nginx/ingress.nix index 7aeb0f3..55da4a0 100644 --- a/hosts/bekkalokk/services/nginx/ingress.nix +++ b/hosts/bekkalokk/services/nginx/ingress.nix @@ -2,17 +2,11 @@ { services.nginx.virtualHosts = { "www2.pvv.ntnu.no" = { + serverAliases = [ "www2.pvv.org" "pvv.ntnu.no" "pvv.org" ]; addSSL = true; enableACME = true; - # TODO after updating the corresponding DNS record: - # serverAliases = [ "www2.pvv.org" "pvv.ntnu.no" "pvv.org" ] - serverAliases = [ "www2.pvv.org" ]; - locations = { - # Redirect the main website - "= /".return = "301 https://www.pvv.ntnu.no/"; - # Proxy home directories "/~" = { extraConfig = '' @@ -39,8 +33,11 @@ "/diverse/abuse.php".return = "301 https://www.pvv.ntnu.no/pvv/CERT/Abuse"; "/nerds/".return = "301 https://www.pvv.ntnu.no/pvv/Nerdepizza"; - # TODO: Redirect web main + # TODO: Redirect webmail "/webmail".return = "301 https://webmail.pvv.ntnu.no/squirrelmail"; + + # Redirect everything else to the main website + "/".return = "301 https://www.pvv.ntnu.no$request_uri"; }; }; };