comparison src/http/ngx_http_core_module.c @ 1155:39a3aa08eefe

disable $document_root variable in the "root/alias" directive
author Igor Sysoev <igor@sysoev.ru>
date Sun, 01 Apr 2007 09:03:14 +0000
parents b8fe8a80e019
children a9005d2e2c99
comparison
equal deleted inserted replaced
1154:427de53e45c2 1155:39a3aa08eefe
2657 return NGX_CONF_ERROR; 2657 return NGX_CONF_ERROR;
2658 } 2658 }
2659 2659
2660 value = cf->args->elts; 2660 value = cf->args->elts;
2661 2661
2662 if (ngx_strstr(value[1].data, "$document_root") != 0
2663 || ngx_strstr(value[1].data, "${document_root}") != 0)
2664 {
2665 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
2666 "the $document_root variable may not be used "
2667 "in the \"%V\" directive",
2668 &cmd->name);
2669
2670 return NGX_CONF_ERROR;
2671 }
2672
2662 lcf->alias = alias; 2673 lcf->alias = alias;
2663 lcf->root = value[1]; 2674 lcf->root = value[1];
2664 2675
2665 if (!alias && lcf->root.data[lcf->root.len - 1] == '/') { 2676 if (!alias && lcf->root.data[lcf->root.len - 1] == '/') {
2666 lcf->root.len--; 2677 lcf->root.len--;