]> git.kaiwu.me - nginx.git/commitdiff
forbid alias inside location given by regular expression
authorIgor Sysoev <igor@sysoev.ru>
Mon, 4 Jun 2007 20:45:45 +0000 (20:45 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 4 Jun 2007 20:45:45 +0000 (20:45 +0000)
src/http/ngx_http_core_module.c

index 2334f6daaafb9823bd9586bd2187f1b6e39763f2..d7694783c88c38ba58e9b779e6e668bbb3309701 100644 (file)
@@ -2674,6 +2674,18 @@ ngx_http_core_root(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
         return NGX_CONF_ERROR;
     }
 
+#if (NGX_PCRE)
+
+    if (lcf->regex && alias) {
+        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+                           "the \"alias\" directive may not be used "
+                           "inside location given by regular expression");
+
+        return NGX_CONF_ERROR;
+    }
+
+#endif
+
     value = cf->args->elts;
 
     if (ngx_strstr(value[1].data, "$document_root")