mod_remoteip 未显示访问者的真实 ip

mod_remoteip 未显示访问者的真实 ip

我正在尝试获取 cloudflare 背后的真实 ip,按照我在 google 上找到的方法,安装了 mod_remoteip,然后按如下方式配置它:

LoadModule remoteip_module modules/mod_remoteip.so
RemoteIPHeader X-Forwarded-For
RemoteIPTrustedProxy 103.21.244.0/22
RemoteIPTrustedProxy 103.22.200.0/22
RemoteIPTrustedProxy 103.31.4.0/22
RemoteIPTrustedProxy 104.16.0.0/13
RemoteIPTrustedProxy 104.24.0.0/14
RemoteIPTrustedProxy 108.162.192.0/18
RemoteIPTrustedProxy 131.0.72.0/22
RemoteIPTrustedProxy 141.101.64.0/18
RemoteIPTrustedProxy 162.158.0.0/15
RemoteIPTrustedProxy 172.64.0.0/13
RemoteIPTrustedProxy 173.245.48.0/20
RemoteIPTrustedProxy 188.114.96.0/20
RemoteIPTrustedProxy 190.93.240.0/20
RemoteIPTrustedProxy 197.234.240.0/22
RemoteIPTrustedProxy 198.41.128.0/17
RemoteIPTrustedProxy 2400:cb00::/32
RemoteIPTrustedProxy 2606:4700::/32
RemoteIPTrustedProxy 2803:f800::/32
RemoteIPTrustedProxy 2405:b500::/32
RemoteIPTrustedProxy 2405:8100::/32
RemoteIPTrustedProxy 2a06:98c0::/29
RemoteIPTrustedProxy 2c0f:f248::/32

当我检查 $_SERVER['HTTP_CF_CONNECTING_IP'] 时,该 IP 不是我的真实 IP,并且 $_SERVER 中没有设置 HTTP_X_FORWARDED_FOR ,该怎么办?

我添加了在 Cloudflare 列表中找到的 IP 列表作为 RemoteIPTrustedProxy,但这不起作用。

相关内容