【待反馈】求大神救救
我要如何nginx启用ngx_http_geoip_module参数,重新安装编译nginx添加上去都没有,不知道为什么 您好,在编译Nginx时,使用--with-http_geoip_module参数来启用ngx_http_geoip_module,然后编辑Nginx的配置文件,添加内容如下,添加完后重启nginxhttp {
geoip_country /path/to/GeoIP/GeoIP.dat;
geoip_city /path/to/GeoIP/GeoLiteCity.dat;
...
server {
...
location / {
if ($geoip_country_code = CN) {
# 针对来自中国的IP地址执行某些操作
}
}
}
}
页:
[1]