Strange try_files behaviour

itpp2012 nginx-forum at nginx.us
Fri Jul 11 19:36:19 UTC 2014


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?

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,251650,251650#msg-251650



More information about the nginx mailing list