mirror of
https://github.com/nginx/nginx.git
synced 2025-06-12 21:52:41 +08:00
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
This commit is contained in:
parent
098d58ec83
commit
ef0fae4279
@ -1282,6 +1282,12 @@ ngx_http_core_try_files_phase(ngx_http_request_t *r,
|
|||||||
if (!alias) {
|
if (!alias) {
|
||||||
r->uri = path;
|
r->uri = path;
|
||||||
|
|
||||||
|
#if (NGX_PCRE)
|
||||||
|
} else if (clcf->regex) {
|
||||||
|
if (!test_dir) {
|
||||||
|
r->uri = path;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
r->uri.len = alias + path.len;
|
r->uri.len = alias + path.len;
|
||||||
r->uri.data = ngx_pnalloc(r->pool, r->uri.len);
|
r->uri.data = ngx_pnalloc(r->pool, r->uri.len);
|
||||||
|
Loading…
Reference in New Issue
Block a user