aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2007-04-01 09:03:14 +0000
committerIgor Sysoev <igor@sysoev.ru>2007-04-01 09:03:14 +0000
commitceab369f4432f9b3e28d37ed6893db4a7640e59a (patch)
tree951863ef735d938e891e6aad4e151862694ab113 /src
parent70f65c4948a9dacf6749bbbda81be7cceaffcd1c (diff)
downloadnginx-ceab369f4432f9b3e28d37ed6893db4a7640e59a.tar.gz
nginx-ceab369f4432f9b3e28d37ed6893db4a7640e59a.zip
disable $document_root variable in the "root/alias" directive
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http_core_module.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 4a957d223..5683c2405 100644
--- 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_command_t *cmd, void *conf)
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];