Hi there,
its possible to get the client ip address at request ?
i read that http-in based on expressjs but there is no msg.req.ip
can anybody help me please
Hi there,
its possible to get the client ip address at request ?
i read that http-in based on expressjs but there is no msg.req.ip
can anybody help me please
You might want to check the msg.req.headers
object (e.g. mine has a field called x-real-ip
), but in my case that was set by an nginx reverse proxy. For a standalone instance, you probably won't have that information available.
How come a simple information as this is not available from this node ?
I have multiple clients in the LAN (hence no need for a rev proxy like nginx), and would like to log the source IP coming onto my node-red server (without having to import the node-red-contrib-http-logger because it is said to be used only for debugging purpose and it's indeed a bit overhead for what I need)
something like msg.req.sourceIP would be handy ....
Go get client ip address at request if you ar using nginx reverse proxy,
you must add something like the following to your NGINX Proxy Configuration:
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
In this case the client ip address will appear here in your msg.req.headers as X-Real-IP.