nginx config fix

This commit is contained in:
Joby 2024-10-21 21:42:41 -05:00
parent 120b72ca0e
commit 0144d4966e

View file

@ -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;
}