3

I need to get the ip address of the users of my website, because I need to present localized content according to country.

I have a load balancing server and because this I use the HTTP_X_FORWARDED_FOR to get the ip address, its ok, but since I set the HTTPS for the entire site I cannot get the HTTP_X_FORWARDED_FOR data, it returns empty, and only can get the REMOTE_ADDR, but this returns the Load Balancing Server ip address and not the user ip address.

How I can get the user's ip address when using load balancing and HTTPS?

I'm using ASP.NET 2.0

Kiquenet
  • 14,494
  • 35
  • 148
  • 243
JoeDev
  • 95
  • 1
  • 9
  • Tip for who gets here: don't rely the localization of your website on an geolocalization over IP information. Try instead to use some tools built for it, like [HTML5 Geolocation API](http://www.w3.org/TR/geolocation-API/) or the GPS of user's device (in case that your application works on smartphones). – Dinei Oct 20 '15 at 14:16

1 Answers1

1

I just discovered that I'm having the exact same problem. In this question they suggest to use HTTP_CLIENT_IP. I haven't tested it myself, let me know if this works.

Community
  • 1
  • 1
Felix Martinez
  • 3,928
  • 3
  • 31
  • 32