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 accesses the URL
http://www.example.com/ and Nginx hits the actual application URL
http://www.example.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? How can I resolve this and fetch the user's actual location?