Getting User's Real IP for Geo Location
Dec 10, 2016 2:18 am by natastna2
Dec 10, 2016 2:18 am by natastna2
Hello,
I was hoping you could help me capture the user's real IP address?
I am trying $_SERVER['HTTP_X_REAL_IP'] and $_SERVER["HTTP_X_FORWARDED_FOR"] but neither seem to be correct.
Thank you for your time.
Regards,
Anthony
Re: Getting User's Real IP for Geo Location
Dec 10, 2016 5:34 pm by natastna2
Dec 10, 2016 5:34 pm by natastna2
Just to provide more info:
When I echo the various SERVER variables when using Gtranslate I get:
xforward 188.65.113.126
xreal 188.65.113.126
xremoteadd 51.255.65.216
serveradd 188.65.113.126
But my actual IP address is: 94.192.59.14
188.65.113.126 is the IP of the server the websites are on and xremote is obviously the URL you are serving from.
I am unsure as to why HTTP_X_REAL_IP would show the IP of the server rather than the user. I am hoping you have seen this before!
Thank you for your time.
Regards,
Anthony
Re: Getting User's Real IP for Geo Location
Dec 10, 2016 6:52 pm by Yana
Dec 10, 2016 6:52 pm by Yana
Hi,
51.255.65.216 and 94.23.220.123 IP addresses are our server IP addresses.
X-Real-IP will display visitors IP address.
Re: Getting User's Real IP for Geo Location
Dec 10, 2016 7:05 pm by natastna2
Dec 10, 2016 7:05 pm by natastna2
Hi Yana,
Thank you for getting back to me.
Oddly I also get 188.65.113.126 as the IP address when I use X-REAL-IP. This is the IP address of the server but not the user.
Thank you for your time.
Regards,
Anthony
Re: Getting User's Real IP for Geo Location
Dec 11, 2016 1:16 am by Edvard
Dec 11, 2016 1:16 am by Edvard
Hi,
Please check with your hosting provider if they are using reverse proxy and ask to set appropriate headers for you. Usually if the request travels through multiple proxy servers the HTTP_X_FORWARDED_FOR header contains all the IP addresses separated by comma.
Thanks!
SIMILAR TOPICS
joomla google translate based on user ip | Aug 15, 2018 10:09 am | Replies: 1 | Post by: ameerjaiswal |
Auto detect the language of the browser/OS/User in Joomla | Feb 23, 2017 5:23 am | Replies: 3 | Post by: emilio_n |
New user. Only one widget instance | Sep 2, 2016 4:12 pm | Replies: 6 | Post by: superdoc |
how to automatic display language by vistors location ? | Nov 25, 2015 1:39 am | Replies: 1 | Post by: henrylee |
Enterprise questions (new user) | Oct 29, 2015 2:08 pm | Replies: 8 | Post by: Bosse |