Routing Configuration
HTTP Access Service supports flexible routing configuration, allowing you to route requests to various backend resources such as CloudBase Run, Cloud Functions, and Static Hosting.
Routing Matching Logic
Routing rules consist of domain and path, where the domain supports the wildcard *
.
- Domain matching follows either exact match or wildcard, with exact match having higher weight than wildcard.
- Path follows the longest matching principle, prioritizing matching the route rule with the highest degree of overlap.
The matching logic is as follows:
Example
Consider the following routing rules:
Domain Path Associated Resource
* / FunctionA
* /bar FunctionB
<Default Domain> /bar FunctionC
foo.com / FunctionD
foo.com /bar FunctionE
foo.com /bar/baz FunctionF
Then:
- If accessing
qux.com/xxx
, it will be routed toFunctionA
; - If accessing
qux.com/bar
, it will be routed toFunctionB
; - If accessing
<Default Domain>/bar
, it will be routed toFunctionC
; - If accessing
<Default Domain>/bar/xxx
, it will be routed toFunctionC
; - If accessing
foo.com/xxx
, it will be routed toFunctionD
; - If accessing
foo.com/bar
, it will be routed toFunctionE
; - If accessing
foo.com/bar/xxx
, it will be routed toFunctionE
; - If accessing
foo.com/bar/baz
, it will be routed toFunctionF
;