Ste*_*son 7 nginx http-headers rate-limiting
我在我们的访问日志中注意到,有时$http_x_forwarded_for未设置变量,相反,正确的 IP 是设置为$remote_addr. 当它不存在时是否可以设置$http_x_forwarded_for为$remote_addr?
基本上,以下伪代码,在 nginx 逻辑中:
if($http_x_forwarded_for == null) $http_x_forwarded_for = $remote_addr
我在 上建立了一些限制请求区域$http_x_forwarded_for,所以我认为这个问题可能是它并不总是生效的原因。
谢谢。
我猜测您已经启用了ngx_http_realip_module并且并非所有代理的 IP 都被列为可信。
| 归档时间: |
|
| 查看次数: |
16373 次 |
| 最近记录: |