Kubernetes Ingress Returns 404 Not Found

A 404 from your Ingress usually isn't your app answering — it's the ingress controller saying "no rule matched this request." The cause is almost always the host, the path, or a backend that has no endpoints.

BytExplorer 6 min read July 17, 2026

You hit your domain and get a bare 404 Not Found — often from nginx or "default backend - 404", not a styled page from your app. That distinction matters: the request reached the ingress controller, but the controller found no rule that matched it and fell through to its default backend. Your app was never contacted.

Step 1: Confirm the rule and the backend

kubectl describe ingress my-ingress     # check Host, Path, and the Backend service:port

Read three things: the host, the path, and the backend (service-name:port). Most 404s are a mismatch in one of them.

Cause 1: The host doesn't match

Ingress rules are matched by the Host: header. If your rule is for app.example.com but you're browsing example.com (or a raw IP), nothing matches → default 404. Test with the exact host:

curl -H "Host: app.example.com" http://<ingress-ip>/

If that works but the browser doesn't, your DNS isn't pointing the hostname at the ingress.

Cause 2: The path or pathType is wrong

A rule with path: /api and pathType: Prefix matches /api and /api/.... With pathType: Exact it matches only /api/api/users 404s. And a rule for /api won't match a request to /. Line the path and pathType up with the URLs you're actually requesting.

Cause 3: The backend Service is wrong or empty

If host and path match but you still 404 (or 503), the rule points at a Service that doesn't exist, uses the wrong port, or has no endpoints. Verify the backend the Ingress names:

kubectl get svc my-svc              # does it exist, on the port the Ingress uses?
kubectl get endpoints my-svc        # <none> means no Ready pods behind it

A Service with no endpoints behind an Ingress is a very common 404/503 source — fix the Service first (see our guide on a Service with no endpoints).

Cause 4: No ingress controller (or wrong ingressClass)

An Ingress object does nothing on its own — a controller (ingress-nginx, Traefik) has to be running and has to own the class. If there's no controller, or your ingressClassName doesn't match one that's installed, the rule is never programmed:

kubectl get pods -n ingress-nginx        # is a controller actually running?
kubectl get ingressclass                 # does your ingressClassName exist?

The checklist

  1. A default/unstyled 404 = the controller matched no rule, not your app.
  2. kubectl describe ingress — verify host, path/pathType, and backend service:port.
  3. Test with curl -H "Host: ..."; if that works, fix DNS.
  4. Confirm the backend Service exists and has endpoints.
  5. Make sure an ingress controller is running and your ingressClassName matches it.

Frequently Asked Questions

Why does my Kubernetes Ingress return 404?

The ingress controller matched no rule and fell through to its default backend — usually a host or path mismatch, or a backend Service that's missing or has no endpoints.

Do I need an ingress controller?

Yes. An Ingress object does nothing on its own; a controller (ingress-nginx, Traefik) must be running and own the ingressClassName your rule uses.

How do I test an Ingress host rule?

Run curl -H "Host: app.example.com" http://<ingress-ip>/. If that works but the browser doesn't, your DNS isn't pointing the hostname at the ingress.

Put it into practice

Stop reading, start building

This pairs with a hands-on BytExplorer course — do it on your own machine and actually keep the skill.

More in Troubleshooting