We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In porting an Express + http-proxy-middleware app, there's something I can't do; match by suffix rather than prefix. My Express code looks like this:
http-proxy-middleware
app.use("*/ping", backendProxy);
That means that any URL like /foo/ping or /bla/ble/blu/ping would be proxied away from this to that backend it was configured to.
/foo/ping
/bla/ble/blu/ping
This would be nice to be able to do with fastify-http-proxy. (Perhaps it's possible with some hacks, but I can't figure it out)
fastify-http-proxy
Another use-case other than the one above is if you wanted to match by file extension. E.g.
server.register(require('@fastify/http-proxy'), { upstream: 'http://my-api.example.com', pattern: '*.webp' });
server.register(require('@fastify/http-proxy'), { upstream: 'http://my-api.example.com', pattern: '*/info' });
or
server.register(require('@fastify/http-proxy'), { upstream: 'http://my-api.example.com', suffix: '/info' });
it would match http://localhost:3000/anything/info or http://localhost:3000/a/b/c/d/info
http://localhost:3000/anything/info
http://localhost:3000/a/b/c/d/info
The text was updated successfully, but these errors were encountered:
Would you like to send a Pull Request to address this issue? Remember to add unit tests.
Sorry, something went wrong.
I don't think this would be feasible.
No branches or pull requests
Prerequisites
🚀 Feature Proposal
In porting an Express +
http-proxy-middleware
app, there's something I can't do; match by suffix rather than prefix.My Express code looks like this:
That means that any URL like
/foo/ping
or/bla/ble/blu/ping
would be proxied away from this to that backend it was configured to.This would be nice to be able to do with
fastify-http-proxy
.(Perhaps it's possible with some hacks, but I can't figure it out)
Motivation
Another use-case other than the one above is if you wanted to match by file extension. E.g.
Example
or
it would match
http://localhost:3000/anything/info
orhttp://localhost:3000/a/b/c/d/info
The text was updated successfully, but these errors were encountered: