nginx config fix
This commit is contained in:
parent
120b72ca0e
commit
0144d4966e
1 changed files with 6 additions and 7 deletions
|
@ -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;
|
||||
}
|
Loading…
Reference in a new issue