# HG changeset patch # User Igor Sysoev # Date 1274966659 0 # Node ID bb5376f3f5857ba9929e807dec51124cf4cc3f31 # Parent a8966b3c1fcf21639948fd8af37be455a9baab0f 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 diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c --- 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);