From 0a535c1c4e736d25b7971a7b15bfe91cfb03aecc Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 16 Jan 2025 08:03:15 +0000 Subject: [PATCH] Add files subdomain vhost --- .../hetznix/services/caddy/vhosts/default.nix | 1 + .../caddy/vhosts/files.oliverdavies.uk.nix | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 nix/hosts/hetznix/services/caddy/vhosts/files.oliverdavies.uk.nix diff --git a/nix/hosts/hetznix/services/caddy/vhosts/default.nix b/nix/hosts/hetznix/services/caddy/vhosts/default.nix index 41e605e..902ef55 100644 --- a/nix/hosts/hetznix/services/caddy/vhosts/default.nix +++ b/nix/hosts/hetznix/services/caddy/vhosts/default.nix @@ -2,6 +2,7 @@ imports = [ ./2020.oliverdavies.uk.nix ./bootstrap-with-tailwind.oliverdavies.uk.nix + ./files.oliverdavies.uk.nix ./florida-drupalcamp-tailwind-css.oliverdavies.uk.nix ./luke.oliverdavies.uk.nix ./phpsw-sculpin-demo.oliverdavies.uk.nix diff --git a/nix/hosts/hetznix/services/caddy/vhosts/files.oliverdavies.uk.nix b/nix/hosts/hetznix/services/caddy/vhosts/files.oliverdavies.uk.nix new file mode 100644 index 0000000..fc0a6e4 --- /dev/null +++ b/nix/hosts/hetznix/services/caddy/vhosts/files.oliverdavies.uk.nix @@ -0,0 +1,15 @@ +{ + services.caddy.virtualHosts."files.oliverdavies.uk" = { + useACMEHost = "oliverdavies.uk"; + + extraConfig = '' + file_server { + header Content-Disposition "attachment" + } + + root * /var/www/vhosts/files.oliverdavies.uk + + header X-Robots-Tag "noindex, nofollow" + ''; + }; +}