Re: Strange try_files behaviour

2014-07-15 Thread itpp2012
With pure Lua and no IF (crossposted in openresty group): location / { try_files $uri $uri/ =404; index index.html index.htm; } location ~ \.php$ { try_files $uri $uri/ =404; rewrite_by_lua ' local s = 0; local

Re: Strange try_files behaviour

2014-07-14 Thread itpp2012
Maxim Dounin Wrote: --- > And we even have a trac ticket for this: > > http://trac.nginx.org/nginx/ticket/86 A tested workaround with Lua and a single IF with a return then: location ~ \.php$ { try_files $uri $uri/ =404;

Re: Strange try_files behaviour

2014-07-13 Thread Maxim Dounin
Hello! On Sun, Jul 13, 2014 at 05:46:50PM -0400, itpp2012 wrote: > Ok clear enough, I'd still consider it some kind of bug (it makes no sense > for try_files to be disabled when an if matches), for example using map and > a single IF does this as well which is more or less nginx's recommended way

Re: Strange try_files behaviour

2014-07-13 Thread itpp2012
Ok clear enough, I'd still consider it some kind of bug (it makes no sense for try_files to be disabled when an if matches), for example using map and a single IF does this as well which is more or less nginx's recommended way of doing an IF with map. Funny thing is when you have a .php location i

Re: Strange try_files behaviour

2014-07-13 Thread Maxim Dounin
Hello! On Sat, Jul 12, 2014 at 06:23:41AM -0400, itpp2012 wrote: > Hmm, more debugging, this config returns a 404 from the backend (which it > shouldn't): > > try_files $uri $uri/ =404; > set $maintmode S; > if ($remote_addr ~ "^(192.168.*.*)$") { set $maintmode L; } > if (-f $document_root/mai

Re: Strange try_files behaviour

2014-07-12 Thread itpp2012
Hmm, more debugging, this config returns a 404 from the backend (which it shouldn't): try_files $uri $uri/ =404; set $maintmode S; if ($remote_addr ~ "^(192.168.*.*)$") { set $maintmode L; } if (-f $document_root/maintenance_mode.html) { set $maintmode "${maintmode}M"; } if ($maintmode = SM) { re

Re: Strange try_files behaviour

2014-07-11 Thread itpp2012
Valentin V. Bartenev Wrote: --- > On Friday 11 July 2014 17:42:41 itpp2012 wrote: > > Ok, debug session here http://pastebin.com/DQ6WBYXU > [..] > > It looks like one case of http://wiki.nginx.org/IfIsEvil Maybe but should an if bypass try_files

Re: Strange try_files behaviour

2014-07-11 Thread Valentin V. Bartenev
On Friday 11 July 2014 17:42:41 itpp2012 wrote: > Ok, debug session here http://pastebin.com/DQ6WBYXU [..] It looks like one case of http://wiki.nginx.org/IfIsEvil wbr, Valentin V. Bartenev ___ nginx mailing list nginx@nginx.org http://mailman.nginx.

Re: Strange try_files behaviour

2014-07-11 Thread itpp2012
Ok, debug session here http://pastebin.com/DQ6WBYXU I see one try_files phase, maybe a script is processed differently then a static file. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,251650,251652#msg-251652 ___ nginx mailing list nginx@ng

Re: Strange try_files behaviour

2014-07-11 Thread Maxim Dounin
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

Strange try_files behaviour

2014-07-11 Thread itpp2012
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 in