Thursday, 13 April 2017

Getting ip address and location of my own server instead of visiting user's

I have a MEAN Stack application deployed on a server and am using Nginx as proxy server to handle the request and redirect to application's particular port.

For example: User access this url http://www.abcxyz.com/ and Nginx hits the actual application url http://www.abcxyz.com:1234/, as my application is running on port 1234.

Now, for analytics purpose I wrote a short script in node.js which fetches ip and location of the users visiting my website. I can see the externally searched queries but i am getting the ip address and location of my own server. Why is that?

Is that because of Nginx? and how can I resolve this and fetch the user's actual location?



via Dynamic Remo

No comments:

Post a Comment