Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem on redirect of the proxy #107

Open
ardf69 opened this issue Apr 22, 2016 · 1 comment
Open

Problem on redirect of the proxy #107

ardf69 opened this issue Apr 22, 2016 · 1 comment

Comments

@ardf69
Copy link

ardf69 commented Apr 22, 2016

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

@lasas
Copy link

lasas commented Apr 20, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants