I have a nginx server as a front end to a node.js application.
When the request gets to the application, I’d like to slightly modify it (the request) and forward it to another node.js application. What would be the best way to do this ?
I was thinking of node-proxy but as I use expressjs in the node apps, I’m not really sure how to use node-proxy and express at the same time.
any idea ?
UPDATE
Could I use res.redirect in my expressjs routes to forward to other node.js application ? I have just tried this but it does not work as expected.
res.redirect(‘http://otherapp.com’) should work if you have your other app listening on another port or host/domain name, but the request object may not be passed on as you expect. How are you modifying it?