mirror of
https://github.com/nginx/nginx.git
synced 2025-06-10 19:42:39 +08:00
disable $document_root variable in the "root/alias" directive
This commit is contained in:
parent
70f65c4948
commit
ceab369f44
@ -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];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user