title |
---|
Router |
A distinguishing feature of Apache APISIX from other API gateways is that it allows you to choose different Routers to better match free services, giving you the best choices for performance and freedom.
You can set the Router that best suits your needs in your configuration file conf/config.yaml
.
A Router can have the following configurations:
-
apisix.router.http
: The HTTP request route. It can take the following values:radixtree_uri
: (Default) Only use theuri
as the primary index. To learn more about the support for full and deep prefix matching, check How to use router-radixtree.Absolute match
: Match completely with the givenuri
(/foo/bar
,/foo/glo
).Prefix match
: Match with the given prefix. Use*
to represent the givenuri
for prefix matching. For example,/foo*
can match with/foo/
,/foo/a
and/foo/b
.match priority
: First try an absolute match, if it didn't match, try prefix matching.Any filter attribute
: This allows you to specify any Nginx built-in variable as a filter, such as URL request parameters, request headers, and cookies.
radixtree_uri_with_parameter
: Likeradixtree_uri
but also supports parameter match.radixtree_host_uri
: Matches both host and URI of the request. Usehost + uri
as the primary index (based on theradixtree
engine).
-
apisix.router.ssl
: SSL loads the matching route.radixtree_sni
: (Default) UseSNI
(Server Name Indication) as the primary index (based on the radixtree engine).