Нужная помощь в nginx geoip2. Как преобразовать if в map?
There was a question! How it is possible without using if but with map in nginx with the module --with_geoip2_module (dynamic) to block all countries except the chosen and all ip except the chosen, to make it work like this:
**if ($lan = yes) {
set $allowed_country yes;
}
if ($allowed_country = no) {
return 503;
}**
but without if?
Centos 7
It`s my /etc/nginx/nginx.conf
load_module modules/ngx_http_geoip2_module.so;
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;