node-http-proxy
node-http-proxy copied to clipboard
QUESTION | Single port route to different services #18
My question is: is http-proxy capable of routing all requests from the 80 to another services based on the url?
If a request comes at the port 80 with that url localhost:80/route1 I want to redirect it to the service at localhost:3001
If a request comes at the port 80 with that url localhost:80/another-route I want to redirect it to the service at localhost:3002
And so on..
To summarize it: I want to expose 1 port(80), and then route the request to other services based on the URL pattern from the request.
That can be done with a little routing on top of this, I do it using express.Router, here's an example that includes that (and some other stuff you probably don't need, just look for the /app1 route), and a blog post about it: https://gist.github.com/Jimbly/d996bd8c80ae1a376a0b