CertGrid CertGrid
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

rewrite-target is an ingress-nginx annotation, not part of the Ingress API. Other controllers spell it differently.

Requests go to the controller's HTTP node port with an explicit Host header.
Server NameIP AddressOSRolesCPURAMHDD
CKA1001192.168.0.175Ubuntu 26.04 LTSControl Plane Node2 Core4 GB50 GB
CKA1001-NODE01192.168.0.176Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE02192.168.0.177Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE03192.168.0.178Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB

This guide includes

Use this when a path-based Ingress returns 404 and you cannot tell who produced it. This matters because the obvious Ingress is wrong in a way that looks exactly like a controller bug, while the 404 is actually coming from your own application.

Before you start

  1. The obvious version, and it returns 404

  2. Ask the backend directly and the answer is the same

  3. rewrite-target, and the capture group it needs

  4. Host routing, and what a miss looks like

Official sources