You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When multiple domains point to the gateway it would be nice to be able to use different APIs and/or paths for them. E.g. api.example.com should proxy all incoming requests to http://httpbin.org while docs.example.com should proxy all incoming requests to https://requestb.in/1f1ww8l1.
This should be possible by using a single hostname, a list of hostnames or a wildcard/regex syntax.
For comparison here is the API configuration documentation for express-gateway and kong where this feature is already supported.
The ExpressJS vhost module can be used to implement this feature.
The text was updated successfully, but these errors were encountered:
We can configure this scenario in tree-gateway through a Router middleware.
Proxy Router is a kind of middleware that can be used to change how the request pipeline will handle your requests. You can define your own middleware function or use one of the already included middlewares.
To route something based on the host header, you could configure something like:
In this example, I am using this middleware, included in the default distribution. It is a simple middleware that can not handle expressions like *.example.com (like vhost that you suggested).
I want to say that I really like the suggestion to support expressions like that and I will add this feature to the next release.
When multiple domains point to the gateway it would be nice to be able to use different APIs and/or paths for them. E.g.
api.example.com
should proxy all incoming requests tohttp://httpbin.org
whiledocs.example.com
should proxy all incoming requests tohttps://requestb.in/1f1ww8l1
.This should be possible by using a single hostname, a list of hostnames or a wildcard/regex syntax.
For comparison here is the API configuration documentation for express-gateway and kong where this feature is already supported.
The ExpressJS vhost module can be used to implement this feature.
The text was updated successfully, but these errors were encountered: