[nginx] Fixed try_files directory test to match only a directory.

Sergey Kandaurov pluknet at nginx.com
Fri Feb 6 10:01:24 UTC 2015


details:   http://hg.nginx.org/nginx/rev/ebdb2023e84a
branches:  
changeset: 5971:ebdb2023e84a
user:      Damien Tournoud <damien at commerceguys.com>
date:      Wed Jan 21 00:26:32 2015 +0100
description:
Fixed try_files directory test to match only a directory.

Historically, it was possible to match either a file or directory
in the following configuration:

    location / {
        try_files $uri/ =404;
    }

diffstat:

 src/http/ngx_http_core_module.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 74edc0ccf27a -r ebdb2023e84a src/http/ngx_http_core_module.c
--- a/src/http/ngx_http_core_module.c	Wed Feb 04 16:22:43 2015 +0300
+++ b/src/http/ngx_http_core_module.c	Wed Jan 21 00:26:32 2015 +0100
@@ -1353,7 +1353,7 @@ ngx_http_core_try_files_phase(ngx_http_r
             continue;
         }
 
-        if (of.is_dir && !test_dir) {
+        if (of.is_dir != test_dir) {
             continue;
         }
 



More information about the nginx-devel mailing list