1.安装相应大陆地址模块库相应的包
yum install libmaxminddb libmaxminddb-devel -y
2.下载 geoip2-nginx 模块
下载地址:
https://github.com/TravelEngineers/ngx_http_geoip2_module
3. 编译 ngx_http_geoip2_module 模块
通过 yum 安装的nginx 没有编译文件,需要自行下载nginx 安装包,进行编译操作
下载nginx
wget http://nginx.org/download/nginx-VERSION.tar.gz
tar zxvf nginx-VERSION.tar.gz
cd nginx-VERSION
编译ngx_http_geoip2_module.so 文件
./configure --add-dynamic-