如果客户不在意大利,客户要求我们阻止对每个 http (80+443) 服务的访问
坏主意,我知道,但客户付款...
请问如何在 nginx 上实现 geoip 过滤器。
我们没有nginx plus。所以我假设我不能使用官方的GeoIp插件(如果这是正确的名字)
您可以在意大利允许所有 IP 地址并在 NGINX 中拒绝其他 IP 地址。
对于IP国家列表,您可以从https://www.ip2location.com/free/visitor-blocker
导出然后您可以编辑文件 /etc/nginx/sites-enabled/website.conf 并添加以下行。
allow <ip>;
allow <ip>;
deny all;