vagusX / koa-proxies

a koa@2.x+ proxy middleware
https://vagusx.github.io/koa-proxies/
MIT License
161 stars 44 forks source link

Incorrect URL in logging when using target path #53

Open milgner opened 4 years ago

milgner commented 4 years ago

After defining a proxy target that includes a URL prefix (http://myproxy/some/path), the requests are proxied to the correct target URL, but the path component of the proxy target is left out of the log message.

I.e. a call to http://myapp/endpoint would call http://myproxy/some/path/endpoint but log a redirect to http://myproxy/endpoint instead.

ralphiech commented 4 years ago

I can confirm what @milgner is reporting here. Looks like the issue is that you are using the URL function in the log call

vagusX commented 3 years ago

@milgner could you please provide a log with your sample?

I test it using the https://github.com/vagusX/koa-proxies/tree/master/samples/js project, and it seems ok

image

aecorredor commented 2 years ago

Confirming this also happens to me.