xorLogic
xorLogic

Reputation: 419

Can I perform GeoIP blocking in NGINX without having to pay for NGINX Plus?

I'm a Fedora 29 enduser looking for a way perform GeoIP blocking via NGINX without having to pay a lot of $$ for Nginx Plus. I saw NGINX can be setup to include modules and wanted to ask if there are any open-source modules that can be used to perform basic GeoIP blocking.

Thanks,

Upvotes: 2

Views: 3340

Answers (1)

Delta
Delta

Reputation: 54

You can build nginx and add the geoip module from nginx https://nginx.org/en/docs/http/ngx_http_geoip_module.html by adding "--with-http_geoip_module" to the nginx build configuration.

Then in your nginx.conf you specify geoip_country or geoip_city followed by a path to a geoip db

https://docs.nginx.com/nginx/admin-guide/security-controls/controlling-access-by-geoip/ can also help with setting up geoip for either open-source or nginx plus

Edit: GeoIP is deprecated but will still work for existing installs.

You can build GeoIP2 from source here https://github.com/leev/ngx_http_geoip2_module with nginx in a similar manner as before

Here is the newer geoip2 database Geolite2 Country

Upvotes: 2

Related Questions