summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2010-08-26 12:33:08 +0000
committerIgor Sysoev <igor@sysoev.ru>2010-08-26 12:33:08 +0000
commitf7dd767e57563b77ecc2c4c4c2fcb7f4973375d1 (patch)
treeefd265588ffb624a7620b1a340fee63e86290b31
parentf380df5e200831aaf7bc9db5390e6d2c84b34cdc (diff)
downloadnginx-f7dd767e57563b77ecc2c4c4c2fcb7f4973375d1.tar.gz
if a location is specified by regex, then always compile an "alias",
even into one static string script: this elimates testing this too specific case inside ngx_http_map_uri_to_path()
-rw-r--r--src/http/ngx_http_core_module.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 6a11a8724..b438907bb 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -3788,13 +3788,19 @@ ngx_http_core_root(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
n = ngx_http_script_variables_count(&clcf->root);
ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
+ sc.variables = n;
+
+#if (NGX_PCRE)
+ if (alias && clcf->regex) {
+ n = 1;
+ }
+#endif
if (n) {
sc.cf = cf;
sc.source = &clcf->root;
sc.lengths = &clcf->root_lengths;
sc.values = &clcf->root_values;
- sc.variables = n;
sc.complete_lengths = 1;
sc.complete_values = 1;