Cloud Native 5 min read

Configure Custom Domains and Path/Header Routing in Alibaba Cloud Knative

This guide walks you through adding a custom domain in Alibaba Cloud Knative and setting up service routing based on URL paths and HTTP headers, showing step‑by‑step console actions, verification URLs, and how to troubleshoot header‑based routing.

Alibaba Cloud Native
Alibaba Cloud Native
Alibaba Cloud Native
Configure Custom Domains and Path/Header Routing in Alibaba Cloud Knative

By default, Knative only supports domain‑based routing with optional suffix templates, which prevents users from specifying a full custom domain and makes path‑ or header‑based routing difficult.

Alibaba Cloud Knative adds a feature that lets you configure a custom domain and define routing rules based on request paths and headers directly from the console.

Adding a Custom Domain

Log in to the Alibaba Cloud Container Service console, navigate to Knative → Component Management , open the Serving component details, and add the domain test.serverless.kuberun.com. Click Confirm to save.

Configuring Route for Login-Service

Select the Login-Service service.

Open the Routing tab and click Configure .

Choose the custom domain test.serverless.kuberun.com.

Set the path to /login and save.

Configuring Route for Search-Service

Select the Search-Service service.

Open the Routing tab and click Configure .

Choose the same custom domain.

Set the path to /search and save.

Testing Service Access

After the routing configuration, open a browser and visit http://test.serverless.kuberun.com/login; the response should be Hello Login Service! . Visiting http://test.serverless.kuberun.com/search returns Hello Search Service! .

Path + Header Routing

For the Login-Service , add a header rule foo=bar in the routing configuration and save. Without the header, a request to http://test.serverless.kuberun.com/login returns 404. After adding the header using a tool such as ModHeader, the request succeeds and returns the expected response.

Using the Alibaba Cloud Knative console, you can quickly set up custom domains and fine‑grained routing rules, enabling production‑ready service access with both path and header based routing.

Alibaba CloudKnativeHeader RoutingCustom DomainPath Routing
Alibaba Cloud Native
Written by

Alibaba Cloud Native

We publish cloud-native tech news, curate in-depth content, host regular events and live streams, and share Alibaba product and user case studies. Join us to explore and share the cloud-native insights you need.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.