Tagged articles
13 articles
Page 1 of 1
Top Architect
Top Architect
Apr 13, 2026 · Operations

How to Block Foreign IPs with Nginx and GeoIP2 – Step‑by‑Step Guide

This article walks through installing the libmaxminddb library, downloading and compiling the ngx_http_geoip2 module, upgrading Nginx to version 1.18, adding the latest GeoLite2 database, configuring Nginx to reject non‑Chinese IPs, and verifying the setup with test requests.

IP blockingNGINXSecurity
0 likes · 8 min read
How to Block Foreign IPs with Nginx and GeoIP2 – Step‑by‑Step Guide
Architect's Guide
Architect's Guide
Apr 10, 2026 · Operations

How to Block Foreign IPs with NGINX and the ngx_http_geoip2 Module

This step‑by‑step guide shows how to install the GeoIP2 library, compile NGINX 1.18 with the ngx_http_geoip2 module, download the latest MaxMind GeoLite2 database, configure geoip2 directives, and verify that foreign IP requests are blocked with a 404 response.

NGINXServer Securityblock foreign IP
0 likes · 7 min read
How to Block Foreign IPs with NGINX and the ngx_http_geoip2 Module
MaGe Linux Operations
MaGe Linux Operations
Feb 27, 2023 · Backend Development

How to Block Foreign IPs in Nginx Using the GeoIP2 Module

This step‑by‑step guide shows how to install the GeoIP2 library, upgrade Nginx, compile the ngx_http_geoip2 module, download the MaxMind GeoLite2 database, configure nginx.conf to detect non‑Chinese IPs, and return a 404 response to block foreign visitors.

ConfigurationServer Securityblock foreign IP
0 likes · 8 min read
How to Block Foreign IPs in Nginx Using the GeoIP2 Module
Architecture Digest
Architecture Digest
Jun 8, 2022 · Backend Development

Blocking Foreign IP Access with Nginx Using the ngx_http_geoip2 Module

This tutorial explains how to prevent overseas IP addresses from reaching a website by installing the libmaxminddb-devel dependency, adding the ngx_http_geoip2 module to Nginx, upgrading to Nginx 1.18, configuring GeoIP2 database paths, mapping country codes, and returning a 404 response for foreign requests.

BackendIP blockingNGINX
0 likes · 7 min read
Blocking Foreign IP Access with Nginx Using the ngx_http_geoip2 Module
Liangxu Linux
Liangxu Linux
May 17, 2021 · Operations

Block Foreign IPs Using NGINX ngx_http_geoip2 Module

This step‑by‑step guide shows how to install the libmaxminddb library, compile NGINX with the ngx_http_geoip2 module, download the latest GeoLite2 database, configure geoip2 directives, and verify that foreign IP addresses are blocked with a 404 response.

DevOpsIP blockingNGINX
0 likes · 8 min read
Block Foreign IPs Using NGINX ngx_http_geoip2 Module
Open Source Linux
Open Source Linux
May 16, 2021 · Information Security

How to Block Foreign IPs in NGINX Using the GeoIP2 Module

This guide walks you through installing the GeoIP2 dependencies, adding the ngx_http_geoip2 module to NGINX, upgrading NGINX, downloading the latest GeoIP2 database, configuring NGINX to block non‑Chinese IPs, and verifying the setup with test requests.

IP blockingLinuxgeoip2
0 likes · 7 min read
How to Block Foreign IPs in NGINX Using the GeoIP2 Module
MaGe Linux Operations
MaGe Linux Operations
May 9, 2021 · Information Security

How to Block Foreign IPs in Nginx Using the ngx_http_geoip2 Module

This guide walks you through installing the ngx_http_geoip2 module, upgrading Nginx, downloading the GeoLite2 database, configuring Nginx to detect foreign IPs, and applying rules that return a 404 response for non‑Chinese visitors, complete with command‑line examples and verification steps.

NGINXServer Configurationblock foreign IP
0 likes · 7 min read
How to Block Foreign IPs in Nginx Using the ngx_http_geoip2 Module