This repository was archived by the owner on Aug 16, 2024. It is now read-only.
forked from erusso7/nginx-geoip-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
47 lines (39 loc) · 1.43 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
worker_processes 2;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 10;
gzip on;
map $http_x_forwarded_for $realip {
~^(\d+\.\d+\.\d+\.\d+) $1; # IPv4
~*([A-F0-9:]*) $1; # Very relaxed IPv6 regex
default $remote_addr;
}
geoip2 geoip/db.mmdb {
auto_reload 60m;
$db_timestamp metadata build_epoch;
$db_last_check metadata last_check;
$db_last_change metadata last_change;
$continent_id source=$realip continent geoname_id;
$continent_code source=$realip continent code;
$continent_name source=$realip continent names en;
$country_id source=$realip country geoname_id;
$country_code source=$realip country iso_code;
$country_name source=$realip country names en;
$city_id source=$realip city geoname_id;
$city_name source=$realip city names en;
$location_acc source=$realip location accuracy_radius;
$location_lat source=$realip location latitude;
$location_lon source=$realip location longitude;
$location_timezone source=$realip location time_zone;
}
server {
listen 80;
default_type application/json;
include endpoints.d/*.conf;
}
}