From 3b48a937c88a79174879d74095f2470a8feb4173 Mon Sep 17 00:00:00 2001 From: Rouven Seifert Date: Thu, 4 Apr 2024 17:12:38 +0200 Subject: [PATCH] nightline & ewsp: add www. subdomain --- modules/web/fsrewsp.nix | 3 +++ modules/web/nightline.nix | 3 +++ 2 files changed, 6 insertions(+) diff --git a/modules/web/fsrewsp.nix b/modules/web/fsrewsp.nix index a64dcc1..57ad6bb 100644 --- a/modules/web/fsrewsp.nix +++ b/modules/web/fsrewsp.nix @@ -36,6 +36,9 @@ in services.nginx.enable = true; services.nginx = { + virtualHosts."www.${domain}" = { + locations."/".return = "301 $scheme://${domain}$request_uri"; + }; virtualHosts."${domain}" = { root = "/srv/web/fsrewsp"; extraConfig = '' diff --git a/modules/web/nightline.nix b/modules/web/nightline.nix index 3ff9165..9cff390 100644 --- a/modules/web/nightline.nix +++ b/modules/web/nightline.nix @@ -33,6 +33,9 @@ in }; services.nginx = { + virtualHosts."www.${domain}" = { + locations."/".return = "301 $scheme://${domain}$request_uri"; + }; virtualHosts."${domain}" = { root = "/srv/web/nightline"; extraConfig = ''