Hands-on Lab·Certified Kubernetes Administrator
Ingress Routing Rules
The obvious path-based Ingress returns 404, and the 404 comes from your application rather than the controller. The path is matched and then forwarded unchanged, so the backend is asked for a directory it does not have.
Services and Networking Guide 58 of 103 Intermediate
- Kubernetes1.36.4
- ingress-nginxcontroller-v1.13.1
- Cluster4 nodes
- CNICalico v3.32.1
- TimeAbout 35 min
- Reviewed21 August 2026
Written against the versions above. rewrite-target is an ingress-nginx annotation, not part of the Ingress API. Other controllers spell it differently.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| CKA1001 | 192.168.0.175 | Ubuntu 26.04 LTS | Control Plane Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE01 | 192.168.0.176 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE02 | 192.168.0.177 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE03 | 192.168.0.178 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
Before you start
- The Ingress controllers guide, which installs the controller and the two backends this one routes to.
- The Services guide.
- A shell with
curlthat can reach a node's HTTP node port.
-
The obvious version, and it returns 404
-
Ask the backend directly and the answer is the same
-
rewrite-target, and the capture group it needs
-
Host routing, and what a miss looks like