diff --git a/hosts/hetznix/services/caddy/vhosts/www.oliverdavies.uk.nix b/hosts/hetznix/services/caddy/vhosts/www.oliverdavies.uk.nix index b9a4dcb8..210248e8 100644 --- a/hosts/hetznix/services/caddy/vhosts/www.oliverdavies.uk.nix +++ b/hosts/hetznix/services/caddy/vhosts/www.oliverdavies.uk.nix @@ -12,6 +12,23 @@ useACMEHost = "oliverdavies.uk"; extraConfig = + let + tomePaths = [ "tome-test" ]; + + tomeConfig = builtins.concatStringsSep "\n\n" ( + builtins.map (path: '' + handle /${path} { + root * /var/www/vhosts/www.oliverdavies.uk-tome + file_server + } + + handle_path /${path}/* { + root * /var/www/vhosts/www.oliverdavies.uk-tome/${path} + file_server + } + '') tomePaths + ); + in '' encode gzip file_server @@ -25,6 +42,8 @@ rewrite @404 /404/index.html file_server } + + ${tomeConfig} '' + builtins.readFile ./www.oliverdavies.uk-redirects.caddy; };