I have a node application that is being served by IIS. I followed this guide and it its all working perfectly:
Im having an issue I understand why its happening with the IP address (because of reverse routing, NODE its tracking 127.0.0.1 instead of the client's IP).
At Node, Im getting the IP as follows:
const ipAddress = req.socket.remoteAddress;
Is there a way from Node to identify the IP address that is hitting IIS?
Thanks.
CodePudding user response:
If you are reverse proxying, you can do this:
const ipAddress = req.headers['x-forwarded-for'] || req.socket.remoteAddress