From 4889d4d8cecb9f1d253e9a2977d83c4775f9d408 Mon Sep 17 00:00:00 2001 From: Xiaochen Wang Date: Wed, 30 Nov 2016 23:39:12 +0800 Subject: [PATCH] Fixed config parsing of the last try_files parameter. --- src/http/ngx_http_core_module.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index fcb706804a..ef8ea43788 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -5316,7 +5316,8 @@ ngx_http_core_try_files(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) tf[i].name = value[i + 1]; if (tf[i].name.len > 0 - && tf[i].name.data[tf[i].name.len - 1] == '/') + && tf[i].name.data[tf[i].name.len - 1] == '/' + && i + 2 < cf->args->nelts) { tf[i].test_dir = 1; tf[i].name.len--;