Welcome! Log In Create A New Profile

Advanced

Re: Strange try_files behaviour

July 12, 2014 06:23AM
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) { return 503; }

This config returns a 404 from nginx, like it should:

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) { return 503; }


So yes it is an IF issue but to my opinion this should not happen.

---
nginx for Windows http://nginx-win.ecsds.eu/
Subject Author Posted

Strange try_files behaviour

itpp2012 July 11, 2014 03:36PM

Re: Strange try_files behaviour

Maxim Dounin July 11, 2014 04:12PM

Re: Strange try_files behaviour

itpp2012 July 11, 2014 05:42PM

Re: Strange try_files behaviour

Valentin V. Bartenev July 11, 2014 06:08PM

Re: Strange try_files behaviour

itpp2012 July 11, 2014 06:21PM

Re: Strange try_files behaviour

itpp2012 July 12, 2014 06:23AM

Re: Strange try_files behaviour

Maxim Dounin July 13, 2014 05:16PM

Re: Strange try_files behaviour

itpp2012 July 13, 2014 05:46PM

Re: Strange try_files behaviour

Maxim Dounin July 13, 2014 06:22PM

Re: Strange try_files behaviour

itpp2012 July 14, 2014 12:44PM

Re: Strange try_files behaviour

itpp2012 July 15, 2014 05:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 278
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready