From 0144d4966e630f1ec3b528fbde288268616b0de0 Mon Sep 17 00:00:00 2001 From: Joby Elliott Date: Mon, 21 Oct 2024 21:42:41 -0500 Subject: [PATCH] nginx config fix --- site-config.conf | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/site-config.conf b/site-config.conf index 0e86f32..f0fb88d 100644 --- a/site-config.conf +++ b/site-config.conf @@ -21,9 +21,13 @@ server { # subdomains are the default, so that we get 404s for nonexistant subdomains set $subdomain ''; set $full_root $MAIN_WEB_ROOT/_main/www; + set $access_log_path $MAIN_WEB_ROOT/logs/$subdomain.access.log; + set $error_log_path $MAIN_WEB_ROOT/logs/$subdomain.error.log; if ($host ~* ^([^.]+)\.$DOMAIN$) { set $subdomain $1; set $full_root $MAIN_WEB_ROOT/subdomains/$subdomain/www; + set $access_log_path $MAIN_WEB_ROOT/logs/_main.access.log; + set $error_log_path $MAIN_WEB_ROOT/logs/_main.error.log; } root $full_root; @@ -70,11 +74,6 @@ server { # Log to both default location and custom site directory, named by subdomain access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; - if ($subdomain != '') { - access_log $MAIN_WEB_ROOT/logs/$subdomain.access.log; - error_log $MAIN_WEB_ROOT/logs/$subdomain.error.log; - }else { - access_log $MAIN_WEB_ROOT/logs/_main.access.log; - error_log $MAIN_WEB_ROOT/logs/_main.error.log; - } + access_log $access_log_path; + error_log $error_log_path; } \ No newline at end of file