2

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

I wrote a short script in node.js which fetches IP and location of the users visiting my website. I can see the searched queries and usage of my API from external users and are same as those I can see via Google Analytics.

But I am also getting a strange hit to my server (and API links) from the IP address ::ffff:127.0.0.1. Why is that? Is that because of Nginx? How can I resolve this? Is this even an actual user or what?

These strange hits are getting intense and I am getting like almost 100,000 hits on daily basis.

Dynamic Remo
  • 421
  • 9
  • 20
  • See [Express.js req.ip is returning ::ffff:127.0.0.1](http://stackoverflow.com/questions/29411551/express-js-req-ip-is-returning-ffff127-0-0-1) – jfriend00 Apr 28 '17 at 15:50
  • Hi @jfriend00, you dont get my question. I am not concerned with the ipv6 prefix. For the actual external users who are visiting my site it works fine, I can fetch their ip, location but my concern is that why i am getting hit from my localhost? The reason for having this 127.0.0.1. Thanks in advance. – Dynamic Remo Apr 28 '17 at 16:05
  • Uhh, because someone accessed your service from localhost or that's the only ip address that could be associated with the request. That's what it is telling you. – jfriend00 Apr 28 '17 at 16:06
  • 1
    Do you use any monitoring tools to monitor if your server is up? – jfriend00 Apr 28 '17 at 16:12
  • 1
    Nope i am not using any monitoring tool its deployed on a simple VPS. Is there a possibility that VPS providers like Atlantic, Dreamhost, Bluehost, DigitalOcean and GoDaddy already have this kind of monitoring tool pre-installed on their VPS? – Dynamic Remo Apr 28 '17 at 16:24
  • You should perhaps capture exactly what the requests coming from that IP address are and maybe the details of the request will shed some light on who's doing it. For example, are you 100% sure that you never open a browser yourself from that machine to test out your own service? – jfriend00 Apr 28 '17 at 16:57
  • I believe i am capturing the right way `var getClientAddress = (req.headers['x-forwarded-for'] || '').split(',')[0] || req.connection.remoteAddress;` with "satelize" package via NPM. It response with the desired output for external users but there are some internal hits from my own 127.0.0.1 and No, i havent used any browser to check my own machine working. – Dynamic Remo Apr 28 '17 at 19:40

0 Answers0