When a request is received, it is matched with list of endpoint definitions to figure out which endpoint should handle the request. The matching is done based on the host header and the path specified in the request.
Endpoint definitions can contain wildcards in both the host and the path section. This article explains the way the matching logic works in detail.
The endpoints are matched according to the following priorities:
In this example there are four endpoints defined, sorted by the aforementioned priorities:
| Endpoint name | Host | Path |
|---|---|---|
| A | bar.example.com |
/* |
| B | *.example.com |
/*/users/* |
| C | example.com |
/foo/* |
| D | example.com |
/* |
The following table contains a list of client requests and their endpoint lookup result.
Client request (host path) |
Lookup result |
|---|---|
example.com / |
Endpoint D |
example.com /bar |
Endpoint D |
example.com /foo |
Endpoint D |
example.com /foo/ |
Endpoint C |
example.com /foo/users |
Endpoint C |
example.com /foo/users/42 |
Endpoint C |
bar.example.com /foo/users |
Endpoint A |
bar.example.com /foo/users/42 |
Endpoint A |
zoo.example.com /foo/users/42 |
Endpoint B |