From 23ad3c1a4743e16daef51bebc4dcc1599055368c Mon Sep 17 00:00:00 2001 From: Chandler Swift Date: Wed, 6 Nov 2024 01:22:11 -0600 Subject: [PATCH] Fix config for stjohnscccc.org --- bert/services/http/stjohnscccc.org.nix | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/bert/services/http/stjohnscccc.org.nix b/bert/services/http/stjohnscccc.org.nix index 7cbc99a..4a65ce1 100644 --- a/bert/services/http/stjohnscccc.org.nix +++ b/bert/services/http/stjohnscccc.org.nix @@ -2,7 +2,7 @@ let app = "stjohnscccc"; domain = "${app}.chandlerswift.com"; # TODO - dataDir = "/srv/www/http/${domain}"; + dataDir = "/srv/www/stjohnscccc.org"; in { services.phpfpm.pools.${app} = { user = app; @@ -22,14 +22,26 @@ in { }; services.caddy.virtualHosts.${domain}.extraConfig = '' root * ${dataDir}/public - encode zstd gzip - file_server - php_fastcgi unix//run/php/php-fpm.sock - log + + handle /downloads/* { + file_server { + browse + hide .gitignore + } + } + + handle { + encode zstd gzip + php_fastcgi unix/${config.services.phpfpm.pools.${app}.socket} + file_server + } + + handle_errors { + respond "{err.status_code} {err.status_text}" + } ''; users.users.${app} = { isSystemUser = true; - createHome = true; home = dataDir; group = app; };