标题:99出一个有管理的a1p域名
作者:menb
原帖:https://hostloc.com/thread-820165-1-1.html
摘要:99出一个有管理的a1p域名 有多少我不知道
我不想折腾了 它绑定了其他全局
在freenom买的 你要转移你出转移费
我将ns转你那给你解析 放我这等过期 我不动这域名
无售后
要的大佬tg或者qq
作者:menb
原帖:https://hostloc.com/thread-820165-1-1.html
摘要:99出一个有管理的a1p域名 有多少我不知道
我不想折腾了 它绑定了其他全局
在freenom买的 你要转移你出转移费
我将ns转你那给你解析 放我这等过期 我不动这域名
无售后
要的大佬tg或者qq
标题:大家小心互联网上那些不要命的歹徒
作者:专业黑人抬棺
原帖:https://hostloc.com/thread-820167-1-1.html
摘要:https://hostloc.com/thread-820020-1-1.html
本来要编辑那贴的,还没来得及写理由就被关贴了
这贴在说下为啥自杀
我遇到了 网络 **
我觉得称之为 **不过分
理由见分页
先证明下我是醋醋本人
作者:专业黑人抬棺
原帖:https://hostloc.com/thread-820167-1-1.html
摘要:https://hostloc.com/thread-820020-1-1.html
本来要编辑那贴的,还没来得及写理由就被关贴了
这贴在说下为啥自杀
我遇到了 网络 **
我觉得称之为 **不过分
理由见分页
先证明下我是醋醋本人
标题:几个月前好像论坛有人发了一个远古个人网站
作者:chitycheng
原帖:https://hostloc.com/thread-820168-1-1.html
摘要:哪个网站地址是多少来着,有人知道不!
作者:chitycheng
原帖:https://hostloc.com/thread-820168-1-1.html
摘要:哪个网站地址是多少来着,有人知道不!
标题:kanju.wang 看剧
作者:poorwebsite
原帖:https://hostloc.com/thread-820170-1-1.html
摘要:kanju.wang 看剧
之前建站就是 看剧网站
域名出售
作者:poorwebsite
原帖:https://hostloc.com/thread-820170-1-1.html
摘要:kanju.wang 看剧
之前建站就是 看剧网站
域名出售
标题:如何建立自己的私有云歌单
作者:88232128
原帖:https://hostloc.com/thread-820171-1-1.html
摘要:这个开源程序还不错,也是loc大佬开发的,介绍给大家试试,用到的是它的自动歌单功能。
教程地址:点击查看详情
作者:88232128
原帖:https://hostloc.com/thread-820171-1-1.html
摘要:这个开源程序还不错,也是loc大佬开发的,介绍给大家试试,用到的是它的自动歌单功能。
教程地址:点击查看详情
标题:好怀恋曾经的淘宝可以买QQ号有便宜号有号
作者:bbw
原帖:https://hostloc.com/thread-820174-1-1.html
摘要:之前花几十块钱买了一个8位的号
三无产品只有密码,改不了,后面永久了就可以改了
号还好记
现在看大佬们买好动不动去富贵,不是被骗就是死贵
作者:bbw
原帖:https://hostloc.com/thread-820174-1-1.html
摘要:之前花几十块钱买了一个8位的号
三无产品只有密码,改不了,后面永久了就可以改了
号还好记
现在看大佬们买好动不动去富贵,不是被骗就是死贵
标题:ceranetworks的AFF是几点个,大家晓得嘛
作者:小黑
原帖:https://hostloc.com/thread-820173-1-1.html
摘要:ceranetworks的AFF是几点个,大家晓得嘛
作者:小黑
原帖:https://hostloc.com/thread-820173-1-1.html
摘要:ceranetworks的AFF是几点个,大家晓得嘛
标题:支付宝打电话过来让把当面付补全信息否则停号。
作者:download
原帖:https://hostloc.com/thread-820176-1-1.html
摘要:我上去1看,网页上没这回事啊,照样用。
作者:download
原帖:https://hostloc.com/thread-820176-1-1.html
摘要:我上去1看,网页上没这回事啊,照样用。
标题:lankodata绍兴NAT测试
作者:251768938
原帖:https://hostloc.com/thread-820177-1-1.html
摘要:为什么不叫测评,因为测评是测试+评价
买的是传家宝套餐,和商家PY到了百兆
要跑什么脚本大佬们告诉我
Superbench ---------------------------------------------------------------------- Superbench.sh -- https://www.oldking.net/350.html Mode : Standard Version : 1.1.7 Usage : wget -qO- sb.oldking.net | bash ---------------------------------------------------------------------- CPU Model : Intel(R) Xeon(R) CPU E5-2650 v2 [url=home.php?mod=space&uid=175]@[/url] 2.60GHz CPU Cores : 1 Cores 2599.998 MHz x86_64 CPU Cache : 16384 KB OS : CentOS 7.9.2009 (64 Bit) KVM Kernel : 3.10.0-1160.el7.x86_64 Total Space : 1.4 GB / 9.3 GB Total RAM : 71 MB / 486 MB (147 MB Buff) Total SWAP : 0 MB / 0 MB Uptime : 0 days 0 hour 1 min Load Average : 0.00, 0.00, 0.00 TCP CC : cubic ASN & ISP : AS4837, CHINAUNICOM CHINA169 Zhejiang Province Network Organization : Hangzhou Sulian Information Technology Co., ltd Location : Beijing, China / CN Region : Beijing ---------------------------------------------------------------------- I/O Speed( 1.0GB ) : 593 MB/s I/O Speed( 1.0GB ) : 780 MB/s I/O Speed( 1.0GB ) : 756 MB/s Average I/O Speed : 709.7 MB/s ---------------------------------------------------------------------- Node Name Upload Speed Download Speed Latency Speedtest.net 99.26 Mbit/s 770.21 Mbit/s 19.36 ms Fast.com 0.00 Mbit/s 0 Mbit/s - Nanjing 5G CT 99.17 Mbit/s 580.60 Mbit/s 18.02 ms Hefei 5G CT 99.60 Mbit/s 515.09 Mbit/s 18.57 ms Guangzhou 5G CT 49.97 Mbit/s 141.69 Mbit/s 25.46 ms TianJin 5G CU 89.23 Mbit/s 607.39 Mbit/s 32.08 ms Shanghai 5G CU 99.25 Mbit/s 858.70 Mbit/s 13.76 ms Guangzhou 5G CU 99.18 Mbit/s 661.75 Mbit/s 24.95 ms Tianjin 5G CM 98.54 Mbit/s 723.84 Mbit/s 35.96 ms Wuxi 5G CM 100.28 Mbit/s 646.08 Mbit/s 17.67 ms Nanjing 5G CM 67.04 Mbit/s 204.80 Mbit/s 19.97 ms Hefei 5G CM 98.17 Mbit/s 836.54 Mbit/s 19.03 ms Changsha 5G CM 99.73 Mbit/s 356.74 Mbit/s 28.84 ms ---------------------------------------------------------------------- Finished in : 5 min 17 sec Timestamp : GMT+8 ---------------------------------------------------------------------- Share result: · https://www.speedtest.net/result/c/572bd07d-33ee-4630-809a-65c2c7790fc4 复制代码
Bench ---------------------------------------------------------------------- CPU Model : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz CPU Cores : 1 CPU Frequency : 2599.998 MHz CPU Cache : 16384 KB Total Disk : 9.3 GB (1.4 GB Used) Total Mem : 486 MB (71 MB Used) Total Swap : 0 MB (0 MB Used) System uptime : 0 days, 0 hour 32 min Load average : 0.00, 0.01, 0.05 OS : CentOS Linux release 7.9.2009 (Core) Arch : x86_64 (64 Bit) Kernel : 3.10.0-1160.el7.x86_64 TCP CC : cubic Virtualization : KVM Organization : AS4837 CHINA UNICOM China169 Backbone Location : Beijing / CN Region : Beijing ---------------------------------------------------------------------- I/O Speed(1st run) : 727 MB/s I/O Speed(2nd run) : 761 MB/s I/O Speed(3rd run) : 759 MB/s Average I/O speed : 749.0 MB/s ---------------------------------------------------------------------- Node Name Upload Speed Download Speed Latency Speedtest.net 98.98 Mbps 507.78 Mbps 19.35 ms Beijing CU 98.47 Mbps 585.43 Mbps 2 ...
作者:251768938
原帖:https://hostloc.com/thread-820177-1-1.html
摘要:为什么不叫测评,因为测评是测试+评价
买的是传家宝套餐,和商家PY到了百兆
要跑什么脚本大佬们告诉我
Superbench ---------------------------------------------------------------------- Superbench.sh -- https://www.oldking.net/350.html Mode : Standard Version : 1.1.7 Usage : wget -qO- sb.oldking.net | bash ---------------------------------------------------------------------- CPU Model : Intel(R) Xeon(R) CPU E5-2650 v2 [url=home.php?mod=space&uid=175]@[/url] 2.60GHz CPU Cores : 1 Cores 2599.998 MHz x86_64 CPU Cache : 16384 KB OS : CentOS 7.9.2009 (64 Bit) KVM Kernel : 3.10.0-1160.el7.x86_64 Total Space : 1.4 GB / 9.3 GB Total RAM : 71 MB / 486 MB (147 MB Buff) Total SWAP : 0 MB / 0 MB Uptime : 0 days 0 hour 1 min Load Average : 0.00, 0.00, 0.00 TCP CC : cubic ASN & ISP : AS4837, CHINAUNICOM CHINA169 Zhejiang Province Network Organization : Hangzhou Sulian Information Technology Co., ltd Location : Beijing, China / CN Region : Beijing ---------------------------------------------------------------------- I/O Speed( 1.0GB ) : 593 MB/s I/O Speed( 1.0GB ) : 780 MB/s I/O Speed( 1.0GB ) : 756 MB/s Average I/O Speed : 709.7 MB/s ---------------------------------------------------------------------- Node Name Upload Speed Download Speed Latency Speedtest.net 99.26 Mbit/s 770.21 Mbit/s 19.36 ms Fast.com 0.00 Mbit/s 0 Mbit/s - Nanjing 5G CT 99.17 Mbit/s 580.60 Mbit/s 18.02 ms Hefei 5G CT 99.60 Mbit/s 515.09 Mbit/s 18.57 ms Guangzhou 5G CT 49.97 Mbit/s 141.69 Mbit/s 25.46 ms TianJin 5G CU 89.23 Mbit/s 607.39 Mbit/s 32.08 ms Shanghai 5G CU 99.25 Mbit/s 858.70 Mbit/s 13.76 ms Guangzhou 5G CU 99.18 Mbit/s 661.75 Mbit/s 24.95 ms Tianjin 5G CM 98.54 Mbit/s 723.84 Mbit/s 35.96 ms Wuxi 5G CM 100.28 Mbit/s 646.08 Mbit/s 17.67 ms Nanjing 5G CM 67.04 Mbit/s 204.80 Mbit/s 19.97 ms Hefei 5G CM 98.17 Mbit/s 836.54 Mbit/s 19.03 ms Changsha 5G CM 99.73 Mbit/s 356.74 Mbit/s 28.84 ms ---------------------------------------------------------------------- Finished in : 5 min 17 sec Timestamp : GMT+8 ---------------------------------------------------------------------- Share result: · https://www.speedtest.net/result/c/572bd07d-33ee-4630-809a-65c2c7790fc4 复制代码
Bench ---------------------------------------------------------------------- CPU Model : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz CPU Cores : 1 CPU Frequency : 2599.998 MHz CPU Cache : 16384 KB Total Disk : 9.3 GB (1.4 GB Used) Total Mem : 486 MB (71 MB Used) Total Swap : 0 MB (0 MB Used) System uptime : 0 days, 0 hour 32 min Load average : 0.00, 0.01, 0.05 OS : CentOS Linux release 7.9.2009 (Core) Arch : x86_64 (64 Bit) Kernel : 3.10.0-1160.el7.x86_64 TCP CC : cubic Virtualization : KVM Organization : AS4837 CHINA UNICOM China169 Backbone Location : Beijing / CN Region : Beijing ---------------------------------------------------------------------- I/O Speed(1st run) : 727 MB/s I/O Speed(2nd run) : 761 MB/s I/O Speed(3rd run) : 759 MB/s Average I/O speed : 749.0 MB/s ---------------------------------------------------------------------- Node Name Upload Speed Download Speed Latency Speedtest.net 98.98 Mbps 507.78 Mbps 19.35 ms Beijing CU 98.47 Mbps 585.43 Mbps 2 ...
标题:【拯救Github】第一天
作者:大白馒头。
原帖:https://hostloc.com/thread-820178-1-1.html
摘要:天津IP所属的联通移动都打不开github了,电信不知道,
然后再油管上看到有人分享用cloudflare worker做带理扶一扶啥的,
有一说一,这玩意拯救github的确快,
给各位mjj分享一下,顺便记录一下这个方法能用多久。
附作者大佬代码短链接:https://mtw.so/5AT2gD
作者:大白馒头。
原帖:https://hostloc.com/thread-820178-1-1.html
摘要:天津IP所属的联通移动都打不开github了,电信不知道,
然后再油管上看到有人分享用cloudflare worker做带理扶一扶啥的,
有一说一,这玩意拯救github的确快,
给各位mjj分享一下,顺便记录一下这个方法能用多久。
附作者大佬代码短链接:https://mtw.so/5AT2gD
标题:大佬们,来白**A1子号吧
作者:木易酱
原帖:https://hostloc.com/thread-820182-1-1.html
摘要:尽情的白**吧:
http://sukhpalschool.com/
作者:木易酱
原帖:https://hostloc.com/thread-820182-1-1.html
摘要:尽情的白**吧:
http://sukhpalschool.com/
标题:RBL是什么东西 刚刚买的机器说IP被加入了RBL黑名单 我草!...
作者:mingxingye
原帖:https://hostloc.com/thread-820181-1-1.html
摘要:邮件内容
Hello,
This is an RBL (Trend Micro) nomination for the following lists of IP addresses that are in the process of being listed to the RBL as a spam source and/or is an originating spam source in progress.
-- IPs listed to the RBL --
-- End of IPs listed to the RBL --
After stop the abuse, you can ask the delist with this link :
作者:mingxingye
原帖:https://hostloc.com/thread-820181-1-1.html
摘要:邮件内容
Hello,
This is an RBL (Trend Micro) nomination for the following lists of IP addresses that are in the process of being listed to the RBL as a spam source and/or is an originating spam source in progress.
-- IPs listed to the RBL --
-- End of IPs listed to the RBL --
After stop the abuse, you can ask the delist with this link :
标题:什么叫“云厂商”解析线路?
作者:louiejordan
原帖:https://hostloc.com/thread-820183-1-1.html
摘要:刚刚收到dnspod的通知,解析升级,只是没弄明白这个云厂商解析线路是什么意思?有懂的普及一下!
作者:louiejordan
原帖:https://hostloc.com/thread-820183-1-1.html
摘要:刚刚收到dnspod的通知,解析升级,只是没弄明白这个云厂商解析线路是什么意思?有懂的普及一下!
标题:跨境电商做自己独立站还是做主流电商平台?纠结
作者:全球主机云
原帖:https://hostloc.com/thread-820184-1-1.html
摘要:跨境电商做自己独立站还是做主流电商平台?纠结 正规的 想好好安心做
作者:全球主机云
原帖:https://hostloc.com/thread-820184-1-1.html
摘要:跨境电商做自己独立站还是做主流电商平台?纠结 正规的 想好好安心做
标题:求一个支持 CNAME flattening 的 DNS 服务
作者:Galileo
原帖:https://hostloc.com/thread-820185-1-1.html
摘要:支持 CNAME flattening
支持国内,国外分开解析
到国内延迟要低,要有香港节点
mjj 给推荐一个
作者:Galileo
原帖:https://hostloc.com/thread-820185-1-1.html
摘要:支持 CNAME flattening
支持国内,国外分开解析
到国内延迟要低,要有香港节点
mjj 给推荐一个
标题:救救孩子吧
作者:财神
原帖:https://hostloc.com/thread-820186-1-1.html
摘要:电脑是win10系统,忘了开机密码了 开机一个多月了不敢关机, 怎么在不需要原密码情况下修改密码
作者:财神
原帖:https://hostloc.com/thread-820186-1-1.html
摘要:电脑是win10系统,忘了开机密码了 开机一个多月了不敢关机, 怎么在不需要原密码情况下修改密码
标题:Nginx根据IP的国家、城市、ASN访问控制
作者:1121744186
原帖:https://hostloc.com/thread-820187-1-1.html
摘要:1、必要前提环境
NGINX
IP数据库
IP数据库下载地址:https://www.maxmind.com 登录后可以免费下载开源的数据库,效果还是很不错的,改网站也提供商业付费的数据库。
-> GeoLite2-ASN.mmdb
-> GeoLite2-City.mmdb
-> GeoLite2-Country.mmdb
ASN 相当于ip的品牌号码,可用来鉴别各个机房的ip,查询对应IDC机房的ASN可以到该网站:http://bgp.he.net
2、安装 libmaxminddb 用于查询 mmdb 数据库
yum -y install libmaxminddb-devel
3、测试工具
mmdblookup --file GeoLite2-Country.mmdb --ip=测试ip
4、安装 ngx_http_geoip2_module
cd /
git clone https://github.com/leev/ngx_http_geoip2_module
进入NGINX的源码目录下,宝塔的话是 /www/server/nginx/src ,
cd /www/server/nginx/src
nginx -V
nginx version: nginx/1.18.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
built with OpenSSL 1.1.1g 21 Apr 2020
TLS SNI support enabled
configure arguments: --user=www --group=www --prefix=/www/server/nginx --add-module=/www/server/nginx/src/ngx_devel_kit --add-module=/www/server/nginx/src/lua_nginx_module --add-module=/www/server/nginx/src/ngx_cache_purge --add-module=/www/server/nginx/src/nginx-sticky-module --with-openssl=/www/server/nginx/src/openssl --with-pcre=pcre-8.43 --with-http_v2_module --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_stub_status_module --with-http_ssl_module --with-http_image_filter_module --with-http_gzip_static_module --with-http_gunzip_module --with-ipv6 --with-http_sub_module --with-http_flv_module --with-http_addition_module --with-http_realip_module --with-http_mp4_module --with-ld-opt=-Wl,-E --with-cc-opt=-Wno-error --with-ld-opt=-ljemalloc --with-http_dav_module --add-module=/www/server/nginx/src/nginx-dav-ext-module
复制 configure arguments:后面的全部内容,再最后面加上 --add-dynamic-module=/ngx_http_geoip2_module
./configure --user=www --group=www --prefix=/www/server/nginx --add-module=/www/server/nginx/src/ngx_devel_kit --add-module=/www/server/nginx/src/lua_nginx_module --add-module=/www/server/nginx/src/ngx_cache_purge --add-module=/www/server/nginx/src/nginx-sticky-module --with-openssl=/www/server/nginx/src/openssl --with-pcre=pcre-8.43 --with-http_v2_module --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_stub_status_module --with-http_ssl_module --with-http_image_filter_module --with-http_gzip_static_module --with-http_gunzip_module --with-ipv6 --with-http_sub_module --with-http_flv_module --with-http_addition_module --with-http_realip_module --with-http_mp4_module --with-ld-opt=-Wl,-E --with-cc-opt=-Wno-error --with-ld-opt=-ljemalloc --with-http_dav_module --add-module=/www/server/nginx/src/nginx-dav-ext-module --add-dynamic-module=/ngx_http_geoip2_module
make
然后在当前目录的 objs 目录下面得到编译好的 ngx_http_geoip2_module.so
nginx.conf
load_module /modules/ngx_http_geoip2_module.so;
http
{
geoip2 /www/ipdb/GeoLite2-Country.mmdb {
auto_reload 60m;
$geoip2_metadata_country_build metadata build_epoch;
$geoip2_data_country_code default=CN source=$remote_addr country iso_code;
$geoip2_data_country_name country names en;
}
geoip2 /www/ipdb/GeoLite2-City.mmdb {
$geoip2_data_city_name default=null city names en;
}
geoip2 /www/ipdb/GeoLite2-ASN.mmdb {
$geoip2_data_asn_code default=0 autonomous_system_number;
$geoip2_data_asn_name default=null autonomous_system_organization;
}
//......省略
}
默认是使用 $remote_addr ,一般反向代理是 X-Forwarded-For ,CF 是 CF-Connecting-IP,需要自定义 使用 source=$remote_addr 设置。
5、测试展示
location /ip
{
default_type text/html;
return 200 '$geoip2_data_country_code $geoip2_data_country_name $geoip2_data_city_name $geoip2_data_asn_name $geoip2_data_asn_code';
}
location /
{
if ($geoip2_data_country_name = "Japan") {
return 444;
}
//....省略
}
最后解释下 $geoip2_data_country_name country names en;
country names en 就是结果的JSON结构,举一反三使用 mmdblookup 工具可以查看数据内容。
{
country:{
names:{
en:"US"
}
}
}
格式化不是很好,具体到 我的博客上看吧 https://lmcw.cn/174.html
作者:1121744186
原帖:https://hostloc.com/thread-820187-1-1.html
摘要:1、必要前提环境
NGINX
IP数据库
IP数据库下载地址:https://www.maxmind.com 登录后可以免费下载开源的数据库,效果还是很不错的,改网站也提供商业付费的数据库。
-> GeoLite2-ASN.mmdb
-> GeoLite2-City.mmdb
-> GeoLite2-Country.mmdb
ASN 相当于ip的品牌号码,可用来鉴别各个机房的ip,查询对应IDC机房的ASN可以到该网站:http://bgp.he.net
2、安装 libmaxminddb 用于查询 mmdb 数据库
yum -y install libmaxminddb-devel
3、测试工具
mmdblookup --file GeoLite2-Country.mmdb --ip=测试ip
4、安装 ngx_http_geoip2_module
cd /
git clone https://github.com/leev/ngx_http_geoip2_module
进入NGINX的源码目录下,宝塔的话是 /www/server/nginx/src ,
cd /www/server/nginx/src
nginx -V
nginx version: nginx/1.18.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
built with OpenSSL 1.1.1g 21 Apr 2020
TLS SNI support enabled
configure arguments: --user=www --group=www --prefix=/www/server/nginx --add-module=/www/server/nginx/src/ngx_devel_kit --add-module=/www/server/nginx/src/lua_nginx_module --add-module=/www/server/nginx/src/ngx_cache_purge --add-module=/www/server/nginx/src/nginx-sticky-module --with-openssl=/www/server/nginx/src/openssl --with-pcre=pcre-8.43 --with-http_v2_module --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_stub_status_module --with-http_ssl_module --with-http_image_filter_module --with-http_gzip_static_module --with-http_gunzip_module --with-ipv6 --with-http_sub_module --with-http_flv_module --with-http_addition_module --with-http_realip_module --with-http_mp4_module --with-ld-opt=-Wl,-E --with-cc-opt=-Wno-error --with-ld-opt=-ljemalloc --with-http_dav_module --add-module=/www/server/nginx/src/nginx-dav-ext-module
复制 configure arguments:后面的全部内容,再最后面加上 --add-dynamic-module=/ngx_http_geoip2_module
./configure --user=www --group=www --prefix=/www/server/nginx --add-module=/www/server/nginx/src/ngx_devel_kit --add-module=/www/server/nginx/src/lua_nginx_module --add-module=/www/server/nginx/src/ngx_cache_purge --add-module=/www/server/nginx/src/nginx-sticky-module --with-openssl=/www/server/nginx/src/openssl --with-pcre=pcre-8.43 --with-http_v2_module --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_stub_status_module --with-http_ssl_module --with-http_image_filter_module --with-http_gzip_static_module --with-http_gunzip_module --with-ipv6 --with-http_sub_module --with-http_flv_module --with-http_addition_module --with-http_realip_module --with-http_mp4_module --with-ld-opt=-Wl,-E --with-cc-opt=-Wno-error --with-ld-opt=-ljemalloc --with-http_dav_module --add-module=/www/server/nginx/src/nginx-dav-ext-module --add-dynamic-module=/ngx_http_geoip2_module
make
然后在当前目录的 objs 目录下面得到编译好的 ngx_http_geoip2_module.so
nginx.conf
load_module /modules/ngx_http_geoip2_module.so;
http
{
geoip2 /www/ipdb/GeoLite2-Country.mmdb {
auto_reload 60m;
$geoip2_metadata_country_build metadata build_epoch;
$geoip2_data_country_code default=CN source=$remote_addr country iso_code;
$geoip2_data_country_name country names en;
}
geoip2 /www/ipdb/GeoLite2-City.mmdb {
$geoip2_data_city_name default=null city names en;
}
geoip2 /www/ipdb/GeoLite2-ASN.mmdb {
$geoip2_data_asn_code default=0 autonomous_system_number;
$geoip2_data_asn_name default=null autonomous_system_organization;
}
//......省略
}
默认是使用 $remote_addr ,一般反向代理是 X-Forwarded-For ,CF 是 CF-Connecting-IP,需要自定义 使用 source=$remote_addr 设置。
5、测试展示
location /ip
{
default_type text/html;
return 200 '$geoip2_data_country_code $geoip2_data_country_name $geoip2_data_city_name $geoip2_data_asn_name $geoip2_data_asn_code';
}
location /
{
if ($geoip2_data_country_name = "Japan") {
return 444;
}
//....省略
}
最后解释下 $geoip2_data_country_name country names en;
country names en 就是结果的JSON结构,举一反三使用 mmdblookup 工具可以查看数据内容。
{
country:{
names:{
en:"US"
}
}
}
格式化不是很好,具体到 我的博客上看吧 https://lmcw.cn/174.html