Express.js official site has this guide. Instructions:
app.set('trust proxy', true)
proxy_set_header X-Forwarded-For $remote_addr
req.ip
This solves it taking into consideration above NGINX config.
var ip = req.headers['x-real-ip'] || req.connection.remoteAddress;