Entendi, use alguns ifs mas eles não devem ser malignos nesse contexto até onde eu sei ..
if (-f $document_root/maintenance.php) {
set $test A;
}
if ($ourips = 0) {
set $test "${test}B";
}
if ($test = AB) {
return 503;
}
error_page 503 @maintenance;
location @maintenance {
rewrite ^(.*)$ /maintenance.php last;
}
location / {
# try to serve file directly, fallback to rewrite
try_files $uri @rewriteapp;
}
location @rewriteapp {
# rewrite all to app.php
rewrite ^(.*)$ /app.php/$1 last;
}
location ~ ^/(app|clear|maintenance)\.php(/|$) {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
}
nginx.conf
geo $ourips {
default 0;
xxx.xxx.xxx.xxx 1;
}