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/