I am setting up a reverse proxy server with node-http-proxy and wanted to know how to pass in a variable to change the outbound request on a per-request basis. I want to make all my calls to the proxy server located at http://localhost:8000 and pass in an "extension" of sorts to the target url of the outbound requests.
For example, the target url of the real server the proxy server is calling on is at http://localhost:9999, and I want to add an extension of /config to that url. So from my front end I would fetch from http://localhost:8000 and pass in the /config extension, and the proxy server would call http://localhost:9999/config for this particular case. Does anyone know how I might go about passing in this string?
Thank you for your help.
http://localhost:9999/config/?/users,/orgs, etc. If I change the target manually to any of them it works but I need it to change based on what the front-end needs/usersor/orgsand you want it to be/config/usersand/config/orgs? Or do you mean that depending on which path is requested, you want to modify the path prefix ('/config') on the fly? If so, check out the documentation section on custom logic