Welcome! Log In Create A New Profile

Advanced

module geoip2 with map directive

Rick Gutierrez
January 21, 2023 05:36PM
Hi list, I'm trying to block some countries to prevent access to three
applications from my app server, the problem is that the list is large
and I want to separate them into a separate file.

I'm using the geoip2 module and when I add the maps directive and make
an include to specify the file it doesn't work.

part of my nginx.conf

map $geoip2_data_country_code $allowed_country {
default yes;
include /etc/nginx/conf.d/geo_country.conf;
}

conf.d/geo_country.conf

NI no; #Nicaragua

nginx -t

nginx: [emerg] unknown directive "NI" in /etc/nginx/conf.d/geo_country.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed

Any ideas, how to do this?


--
rickygm

http://gnuforever.homelinux.com
_______________________________________________
nginx mailing list
nginx@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

module geoip2 with map directive

Rick Gutierrez January 21, 2023 05:36PM

Re: module geoip2 with map directive

Francis Daly January 21, 2023 08:18PM

Re: module geoip2 with map directive

Rick Gutierrez January 23, 2023 12:40PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 130
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready