aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2010-05-27 13:24:19 +0000
committerIgor Sysoev <igor@sysoev.ru>2010-05-27 13:24:19 +0000
commitef0fae4279b7190a9a24d15fc14be1bc59e7c344 (patch)
tree58e0985fb1237ef7e34c46c1d7bc4a2aaf806334 /src
parent098d58ec83eab89f8bc2f97345276620f2dd762c (diff)
downloadnginx-ef0fae4279b7190a9a24d15fc14be1bc59e7c344.tar.gz
nginx-ef0fae4279b7190a9a24d15fc14be1bc59e7c344.zip
do not add tested file to a location regex string,
instead, set URI to the tested file, or keep URI unchanged, if the tested file is a directory, the later allows to handle a directory autoredirect
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http_core_module.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 997ed3a8d..a91d5854b 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -1282,6 +1282,12 @@ ngx_http_core_try_files_phase(ngx_http_request_t *r,
if (!alias) {
r->uri = path;
+#if (NGX_PCRE)
+ } else if (clcf->regex) {
+ if (!test_dir) {
+ r->uri = path;
+ }
+#endif
} else {
r->uri.len = alias + path.len;
r->uri.data = ngx_pnalloc(r->pool, r->uri.len);