Mercurial > hg > nginx
changeset 2458:43dcf8cc2cb1
allow directories in try_files
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 21 Jan 2009 12:11:22 +0000 |
parents | 1aff348d9aa8 |
children | f732b8509658 |
files | src/http/ngx_http_core_module.c src/http/ngx_http_core_module.h |
diffstat | 2 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/ngx_http_core_module.c Mon Jan 19 16:42:14 2009 +0000 +++ b/src/http/ngx_http_core_module.c Wed Jan 21 12:11:22 2009 +0000 @@ -1038,6 +1038,7 @@ ssize_t reserve, allocated; u_char *p, *name; ngx_str_t path; + ngx_uint_t test_dir; ngx_http_try_file_t *tf; ngx_open_file_info_t of; ngx_http_script_code_pt code; @@ -1133,6 +1134,8 @@ } } + test_dir = tf->test_dir; + tf++; ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, @@ -1172,7 +1175,7 @@ continue; } - if (!of.is_file) { + if (of.is_dir && !test_dir) { continue; } @@ -3853,6 +3856,11 @@ tf[i].name = value[i + 1]; + if (tf[i].name.data[tf[i].name.len - 1] == '/') { + tf[i].test_dir = 1; + tf[i].name.len--; + } + n = ngx_http_script_variables_count(&tf[i].name); if (n) {