Skip to main content

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 to FunctionA;
  • If accessing qux.com/bar, it will be routed to FunctionB;
  • If accessing <Default Domain>/bar, it will be routed to FunctionC;
  • If accessing <Default Domain>/bar/xxx, it will be routed to FunctionC;
  • If accessing foo.com/xxx, it will be routed to FunctionD;
  • If accessing foo.com/bar, it will be routed to FunctionE;
  • If accessing foo.com/bar/xxx, it will be routed to FunctionE;
  • If accessing foo.com/bar/baz, it will be routed to FunctionF;