Kubernetes Ingress Path only works with /
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
If an Ingress only seems to work for the root path /, the problem is usually not Kubernetes itself but the combination of path matching, controller behavior, and backend application routing. In practice, the fix usually lives in one of three places: the pathType, the ingress-controller rewrite rules, or the application behind the service.
Start With A Minimal Correct Rule
A basic prefix rule should look like this:
With pathType: Prefix, requests such as /app and /app/login should route to the backend.
Why Only / Often Works
The common reasons are:
- the path was defined with the wrong
pathType - the controller expects controller-specific annotations for regex or rewrite behavior
- the backend app only serves content correctly from
/and breaks when mounted under a subpath - the service works, but generated links, redirects, or static assets still point at the root path
That last point is especially common with web apps that were never configured to run behind /app or another prefix.
The Backend App May Be The Real Problem
Even if the ingress forwards /app correctly, the backend may respond with redirects or HTML that assumes it is mounted at /. Then the browser requests /css/site.css instead of /app/css/site.css, and it looks like only the root route works.
In other words, ingress routing can be correct while the application is subpath-unaware.
Rewrite Example For NGINX Ingress
Some backends expect the prefix to be stripped before the request reaches them. For an NGINX-based controller, a rewrite annotation is a common fix.
Now a request to /app can be forwarded to / on the backend service, which often matches how the application is actually built.
Check The Controller You Are Using
Different ingress controllers interpret advanced path features differently. ImplementationSpecific in particular means the controller decides the matching behavior. If you expected regex-like path handling, verify that your controller actually supports it and that you enabled the right annotations.
For basic path routing, prefer Prefix or Exact unless you have a controller-specific reason not to.
Debugging Checklist
A short checklist helps isolate the failure:
- verify the service works directly with port-forwarding
- verify the ingress path and
pathType - inspect controller logs for rule parsing errors
- check whether the backend app supports being served from a subpath
- test whether a rewrite target is required
This separates ingress configuration problems from backend application problems quickly.
Common Pitfalls
The most common mistake is assuming path routing failed when the real problem is that the backend app generates root-relative redirects or asset URLs.
Another mistake is using ImplementationSpecific and expecting portable behavior across controllers.
A third issue is adding rewrite annotations without understanding whether the application expects /app/... or /... once the request reaches the backend.
Summary
- If only
/works, inspect path matching, rewrites, and backend subpath support together. - Use
PrefixorExactdeliberately instead of relying on controller-specific defaults. - A working service behind port-forward but a broken Ingress usually points to path or rewrite configuration.
- A correctly routed request can still fail if the backend application assumes it lives at
/. - Controller logs and direct service tests are the fastest way to isolate the real cause.
Related reading
- Kubernetes ingress rules How to use wildcard and specific subdomain together
- Kubernetes Ingress same with with master-slave architecture
- kubernetes ingress service annotations
- Kubernetes Ingress service can not load static files
- Kubernetes Ingress to External Service?
- Kubernetes Ingress vs. Service with externalIPs
- Kubernetes is starting ..... forever error on windows 10
- Kubernetes Javascript Client Library works on local but not on GKE

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.