This is a kong plug-in, which mainly uses the ip2region library to filter the attribution information of some IPs and prohibit access.
https://github.com/lionsoul2014/ip2region
1.select your lua version directory plugin 2.Move the entire ip-region-restriction directory to your kong plugins directory 3.modify ip-region-restriction/ip_restriction.lua line:4 db_path="your ip2regeion.db file path" 3.modify /etc/kong/kong.conf:
plugins=bundled,ip-region-restriction
Restart kong (kong restart)
kong restart
or reload (kong prepare && kong reload)
kong prepare && kong reload
Verify that the plugin loaded successfully
curl -s 127.0.0.1:8001 | jq '.plugins.available_on_server' | grep 'ip-region-restriction'