On Jan 21, 2015, at 2:54 AM, Damien Tournoud <dam...@commerceguys.com> wrote: > # HG changeset patch > # User Damien Tournoud <dam...@commerceguys.com> > # Date 1421796392 -3600 > # Wed Jan 21 00:26:32 2015 +0100 > # Node ID c8f2fbe53f5df811dcaada94d3eca6c34070c610 > # Parent 0a198a517eaf48baad03a76b182698c50496d380 > http_core: Do not match a file for a directory in try_files. > > A try_files directive with a file match (i.e. something > not ending with a "/") does not match a directory of > the same name. > > But a try_files directive with a directory match like this: > > try_files $uri/ =404; > > ... does currently match a *file* of the same name. >
Indeed, it is odd to lookup a regular file with a trailing slash, since this is generally only allowed for directories. > > diff -r 0a198a517eaf -r c8f2fbe53f5d src/http/ngx_http_core_module.c > --- a/src/http/ngx_http_core_module.c Wed Jan 14 09:03:35 2015 +0300 > +++ b/src/http/ngx_http_core_module.c Wed Jan 21 00:26:32 2015 +0100 > @@ -1353,7 +1353,7 @@ > continue; > } > > - if (of.is_dir && !test_dir) { > + if (of.is_dir != test_dir) { > continue; > } > The patch looks good to me. -- Sergey Kandaurov _______________________________________________ nginx-devel mailing list nginx-devel@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx-devel