Nginx
为 Nginx 开启 Geoip 模块以屏蔽特定国家/地区的访问
因为之前是通过 apt-get 方式安装的 Nginx,默认没有带 geoip module,需要安装: apt-get install nginx-module-geoip 然后编辑 /etc/nginx/nginx.conf vim /etc/nginx/nginx.conf 按 i 进入编辑模式,在最上方新增一行: load_module modules/ngx_http_geoip_module.so; 在 http{ 下方新增以下几行 geoip_country /usr/share/GeoIP/GeoIP.dat; map $geoip_country_code $allowed_country { default