在nginx.conf通过设置访问GeoIP。被禁止的国家列表太长了,将所有这些都写入配置文件并不完全合乎逻辑。我想澄清一下这个国家列表是否可以放在一个单独的.txt文件中,并在我需要的地方阅读nginx.conf。
geoip_country /usr/share/GeoIP/GeoIP.dat;
map $geoip_country_code $allowed_country {
default no;
FK no;
FM no;
EH no;
ТУТ БУДЕТ ЕЩЕ СПИСОК СТРАН!!!! ЗАМЕНИТЬ НА СЧИТКУ ИЗ ФАЙЛА!
}
在地图块内,包括
include. 请参阅文档http://nginx.org/ru/docs/http/ngx_http_map_module.html