# HG changeset patch # User Igor Sysoev # Date 1175418194 0 # Node ID 39a3aa08eefe576759af52e8585656e767341e85 # Parent 427de53e45c22d754d707d74c001cdee845084b3 disable $document_root variable in the "root/alias" directive diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -2659,6 +2659,17 @@ ngx_http_core_root(ngx_conf_t *cf, ngx_c value = cf->args->elts; + if (ngx_strstr(value[1].data, "$document_root") != 0 + || ngx_strstr(value[1].data, "${document_root}") != 0) + { + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, + "the $document_root variable may not be used " + "in the \"%V\" directive", + &cmd->name); + + return NGX_CONF_ERROR; + } + lcf->alias = alias; lcf->root = value[1];