All I’m trying to do it redirect all users, apart from my ip address, to a “site down” page using the following
location / {
rewrite (.*) /sitedown.php redirect;
allow 94.12.147.139;
index index.html index.php;
try_files $uri $uri/ @handler;
expires 30d;
}
It redirects fine but won’t allow my IP to access the site either. Any help would be grateful.
the following should work: