fixing an infinity loop issue
map $remote_addr $notwhitelisted_ip {
default 1;
# VPN
1.2.3.4 0;
}
server {
...
set $maintenance_redirect 0;
if ($notwhitelisted_ip = 1) {
set $maintenance_redirect 1;
}
if ($request_uri = "/maintenance-vik.html") {
set $maintenance_redirect 0;
}
if ($maintenance_redirect = 1) {
return 301 /maintenance-vik.html;
}
...