Strange try_files behaviour

Maxim Dounin mdounin at mdounin.ru
Fri Jul 11 20:11:39 UTC 2014


Hello!

On Fri, Jul 11, 2014 at 03:36:19PM -0400, itpp2012 wrote:

> Simple php config (nginx 1.7.4 development);
> 
>     server {
> [...]
>         location ~ \.php$ {
>             try_files $uri $uri/ =404;
>             index  index.html index.htm index.php;
>             fastcgi_ignore_client_abort on;
>             fastcgi_pass   myLoadBalancer;
>             fastcgi_index  index.php;
>             fastcgi_param  SCRIPT_FILENAME 
> $document_root$fastcgi_script_name;
>             include        fastcgi_params;
>         }
>         location / {
>             try_files $uri $uri/ =404;
>             index  index.html index.htm;
>         }
>     }
> 
> None existing file:
> "GET /viewforum.pp?f=3 HTTP/1.1" 404 180 "-"
> a proper 404 from nginx.
> 
> However a different approach also with a none existing file:
> "GET /viewforu.php?f=3 HTTP/1.1" 404 56 "-"
> returns a 404 from the backend and a 'no input file specified'
> 
> Neither files exist yet the second test is going past try_files.
> 
> Anyone any idea if this is a config issue or a bug?

I would suggest it's a config issue.  Note though that the config 
snippet provided isn't enough to conclude anything.

If in doubt, try debug log.
See http://nginx.org/en/docs/debugging_log.html for details.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list