Proxies are a pain, right? For the nodejs request source hostname, you gotta check multiple headers.
Try this:
```javascript
const host = req.headers['x-real-ip'] || req.headers['x-forwarded-for'] || req.connection.remoteAddress;
```
If you’re using NGINX, make sure it’s passing the right headers.
Also, the `request-ip` package is handy for this: [request-ip npm](https://www.npmjs.com/package/request-ip).
Try this:
```javascript
const host = req.headers['x-real-ip'] || req.headers['x-forwarded-for'] || req.connection.remoteAddress;
```
If you’re using NGINX, make sure it’s passing the right headers.
Also, the `request-ip` package is handy for this: [request-ip npm](https://www.npmjs.com/package/request-ip).
