You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No offense, and maybe I got something wrong but my understanding of a proxy such as nginx is that you can target multiple apps via multiple hostnames/domains, e.g. example1.com and example2.com have both the same A record and a proxy is sending traffic to the right apps and handling diff. ssl certs, etc..
Unsure if this is possible with node-http-proxy.
Everything else which is described in the docs seems to be easily done with plain node and/or standard node-web/http-libs which are used anyway.
The text was updated successfully, but these errors were encountered:
You can do that with this library, I'm using it for an API gateway that allows for host header based routing for backwards compatibility. Minimal example:
constproxies={}consthost1Proxy=httpProxy.createProxyServer({/* your config here, including certs if need be */})proxies.host1=host1Proxyconsthandler=(req,res)=>{consthost=req.headers.hostif(proxies[host]){proxies[host].web(req,res,{/* options here */})return}handle404Case(req,res)}http.createServer(handler).listen(port)
No offense, and maybe I got something wrong but my understanding of a proxy such as nginx is that you can target multiple apps via multiple hostnames/domains, e.g. example1.com and example2.com have both the same A record and a proxy is sending traffic to the right apps and handling diff. ssl certs, etc..
Unsure if this is possible with node-http-proxy.
Everything else which is described in the docs seems to be easily done with plain node and/or standard node-web/http-libs which are used anyway.
The text was updated successfully, but these errors were encountered: