I collect statistics on IP addresses from where users visit my site and I have noticed what there are only two IP addresses presented, 172.16.16.1 and 172.16.16.248. The property I use to determine IP address is
Request.UserHostAddress
What could be a reason of IP address information losing? All the users are from around the world, so they cann't be behind only two proxies.
You might want to something like this;
string SourceIP = String.IsNullOrEmpty(Request.ServerVariables["HTTP_X_FORWARDED_FOR"]) ? Request.ServerVariables["REMOTE_ADDR"] : Request.ServerVariables["HTTP_X_FORWARDED_FOR"].Split(",")[0];
The HTTP_X_FORWARDED_FOR header gets the IP address behind proxy servers.
See this page that explains why in more detail; Getting The Real IP of your Users
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With