Impossible to ignore proxy path prefix
See original GitHub issueHi,
I need to proxy requests from /api
to the root of other site: http://test.com
:
/api/users
-> http://test.com/users
/api/users/1
-> http://test.com/users/1
But all my requests lead to http://test.com/api/*
How to ignore /api
prefix but not to ignore other path?
When I use ignorePath
settings all my requests lead to http://test.com
.
Config:
server.middleware = proxyMiddleware('/api', {target: 'http://test.com', proxyHost: 'test.com'});
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
NGINX proxy_pass remove path prefix & resolve DNS
Essentially all I want to achieve here is to proxy a request while removing the path prefix in such a way that DNS...
Read more >We need to talk: Can we standardize NO_PROXY? - GitLab
You may be less familiar with no_proxy , which provides a way to exclude traffic destined to certain hosts from using the proxy....
Read more >Set up a proxy integration with a proxy resource - Amazon API ...
To set up a proxy integration in an API Gateway API with a proxy resource, you perform the following tasks: Create a proxy...
Read more >http-proxy-middleware - npm
Start using http-proxy-middleware in your project by running `npm i ... specify whether you want to ignore the proxy path of the incoming ......
Read more >Proxy support in Chrome
Specifying an HTTPS proxy is generally not possible through system proxy settings. Instead, one must use either a PAC script or a Chrome...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah, didn’t read your question well… 😃
You can rewrite paths with the
pathRewrite
option. https://www.npmjs.com/package/http-proxy-middleware#optionsCan we add a
boolean
option to plainly avoid path prefixing.pathRewrite
still sound complex.