【发布时间】:2021-04-17 03:14:39
【问题描述】:
基本概述
我们正在尝试在我们的服务器上设置Rate Limiting。我们使用Nginx 作为网络服务器,fail2ban 使用Iptables 阻止 IP。
如果请求直接命中我们的 Nginx 服务器,IPtables 可以阻止 IP(在这种情况下,$remote_addr 是客户端 IP)。
但是如果它来自某个代理服务器,那么代理服务器会在 X-Fordwarded-For 标头中传递客户端 IP,并且 Iptables 无法检测到(在这种情况下,$remote_addr 是代理服务器 IP)。
还有其他我们可以阻止X-Fordwarded-For 标头IP 的方法吗?
任何帮助都将是可观的
IPtable IP 阻止命令 - iptables -A INPUT -s 111.112.212.112 -j DROP
【问题讨论】:
-
我投票结束这个问题,因为一般 IPTABLES 支持是题外话。支持问题可以通过superuser.com 提出。仅将此标签用于有关使用 iptables 进行编程的问题。有关配置 iptables 的问题应在 Server Fault (serverfault.com/tour) 上提出。
标签: nginx firewall iptables rate-limiting fail2ban