From 5d9524dbdff8b228ee06c0ef83c549bfbc2b1dee Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 31 Mar 2023 21:53:11 +0000 Subject: [PATCH] modules: services: blog: better blog redirection --- modules/services/blog/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/services/blog/default.nix b/modules/services/blog/default.nix index 5c508a3..3d3fbdb 100644 --- a/modules/services/blog/default.nix +++ b/modules/services/blog/default.nix @@ -23,13 +23,21 @@ in forceSSL = true; useACMEHost = domain; root = "/var/www/blog"; - default = true; # Redirect to my blog # http://www.gnuterrypratchett.com/ extraConfig = '' add_header X-Clacks-Overhead "GNU Terry Pratchett"; ''; }; + + # Dummy vhost to redirect all unknown (sub-)domains to my blog + "_" = { + forceSSL = true; + useACMEHost = domain; + default = true; + + locations."/".return = "301 https://belanyi.fr$request_uri"; + }; }; # Those are all subdomains, no problem