gulp-webserver icon indicating copy to clipboard operation
gulp-webserver copied to clipboard

Problem on redirect of the proxy

Open ardf69 opened this issue 8 years ago • 1 comments

If the proxy needs a redirect the system makes a wrong redirect. Example:

target: http://xxxx/bill source: /bill original redirect http://xxxx/bill/v1/... calculated redirect: //v1/...

The problem is that proxy-middleware needs options.route valued on the redirect. A working solution is to modify index.js at the line 149

app.use(config.proxies[i].source, proxy(proxyoptions));

as follow

proxyoptions.route = config.proxies[i].source; app.use(proxy(proxyoptions));

Ciao Angelo

ardf69 avatar Apr 22 '16 14:04 ardf69

I tried you solution, but it didn't worked. So I replaced "proxies" section with "middleware" and used "http-proxy-middleware"

lasas avatar Apr 20 '17 11:04 lasas