Question: I need to get the ip address of client using my application in the request of hapijs node... we are using pm2 and Nginx for server to run live and we have used the request.info.address but it gives the server local ip as 127.0.0.1 but what i need was the client's IP who uses my application eg: 192.x.x.111 ...

Answer: 
I always get client IP address with this function :)

```
    return request.headers['x-forwarded-for'] ||
    request.connection.remoteAddress ||
    request.socket.remoteAddress ||
    request.connection.socket.remoteAddress;

```

Hope it helps.
I'm running the same stack for my hapi apps with nginx and PM2. Proxying requests through nginx to a node app on the same host will always result in `127.0.0.1` for the remote address, because nginx forwards the request on the same host.

**Solution:** there's a dedicated plugin [hapi-geo-locate](https://github.com/fs-opensource/hapi-geo-locate) that determines the actual client IP address even though you're running your app behind a reverse proxy (like nginx).

[hapi-geo-locate](https://github.com/fs-opensource/hapi-geo-locate) supports various proxies and HTTP headers, so you should be save and get the user's IP running your app on different platforms.

Hope that helps!