location / { if ($remote_addr ~ "^__IP4_NAT_PREFIX__.\d+$") { return 302 __CAPTIVE_PORTAL_URL__; } return 302 https://$http_host/yunohost/admin; }