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로 추가했지만 작동하지 않았습니다.

ベストアンサー1

おすすめ記事