php - $_SERVER["REMOTE_ADDR"] giving 10.0.0.X instead of the client IP
one text
Solution:
My guess is that there's a proxy between the Internet and the server. In such situation, check the Forwarded-For
headers' family, for example X-Forwarded-For
.
Attention! Don't trust all IP's from X-Forwarded-For
as they can be set by clients. Take the first one from the right, which is not set by your infrastructure (utilize trusted proxies
approach). Unfortunately, you have to know your network architecture.
How to use HTTP_X_FORWARDED_FOR properly?
Source