Skip to content

Commit 0ea8729

Browse files
committed
add nginx geoip
1 parent 10f547c commit 0ea8729

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

nginx/geoip.dat

737 KB
Binary file not shown.

nginx/http/geoip.conf

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
geoip_country <%=nginxPrefix%>/geoip.dat;
3+
geoip_proxy 192.168.0.1/16;
4+
geoip_proxy 10.10.0.1/16;
5+
geoip_proxy 127.0.0.1/16;
6+
geoip_proxy_recursive on;
7+
8+
# Cloudflare
9+
geoip_proxy 204.93.240.0/24;
10+
geoip_proxy 204.93.177.0/24;
11+
geoip_proxy 199.27.128.0/21;
12+
geoip_proxy 173.245.48.0/20;
13+
geoip_proxy 103.21.244.0/22;
14+
geoip_proxy 103.22.200.0/22;
15+
geoip_proxy 103.31.4.0/22;
16+
geoip_proxy 141.101.64.0/18;
17+
geoip_proxy 108.162.192.0/18;
18+
geoip_proxy 190.93.240.0/20;
19+
geoip_proxy 188.114.96.0/20;
20+
geoip_proxy 197.234.240.0/22;
21+
geoip_proxy 198.41.128.0/17;
22+
geoip_proxy 162.158.0.0/15;

nginx/partial/proxy-3000

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
proxy_set_header X-Real-IP $remote_addr;
22
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
3+
proxy_set_header X-Nginx-Geo $geoip_country_code;
4+
35
proxy_set_header Host $http_host;
46

57
proxy_pass http://127.0.0.1:3000;

0 commit comments

Comments
 (0)