Answer the question
In order to leave comments, you need to log in
How to set X-Forwarded-For header in request?
Hello. There is a proxy server written using the express-http-proxy library on node.js. I need the client's IP address to be stored in the request. In nginx, you can set the header proxy_set_header X-Real-IP $remote_addr; or proxy_set_header X-Forwarded-For $remote_addr;
How to do this in Node.js???
Answer the question
In order to leave comments, you need to log in
req.headers['someHeader'] = 'someValue'
This kind of code can be added to the middleware, which will be processed for each proxied request.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question