changeset 3533:bb5376f3f585

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
author Igor Sysoev <igor@sysoev.ru>
date Thu, 27 May 2010 13:24:19 +0000
parents a8966b3c1fcf
children 3711bb1336c3
files src/http/ngx_http_core_module.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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_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);