我经过反向代理将网站的推送服务转移到另一个服务器,现在还想对这块内容进行限流,
在新服务器设置限流时使用 MAP 之后,限制结果还是只能针对内网的服务器,而不是针对真实IP
反向代理配置
proxy_set_header X-Forwarded-For $remote_addr;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header Host $host;
限流配置
map $http_x_forwarded_for $clientRealIp {
"" $remote_addr;
~^(?P<firstaddr>[0-9\.]+),?.*$ $firstAddr;
}
#limit_req_zone $binary_remote_addr zone=allips:10m rate=2r/m;
limit_req_zone $clientRealIp zone=allips:10m rate=2r/m;
limit_req zone=allips burst=5 nodelay;
请问一下要怎样才能对真实 IP 限流呢。