Ingress returns "404 Not Found" / "default backend - 404" (ingress-nginx)
The ingress controller received the request but no Ingress rule matched the host/path, so it answered with its default backend.
Seen on:
Kubernetes
Meaning
ingress-nginx serves a 404 page when the Host header or path doesn’t match any rule, the Ingress lacks the right ingressClassName (so this controller ignores it), or the path type/rewrite doesn’t match the URL.
Common causes
- Missing or wrong ingressClassName (controller ignores the Ingress)
- Host in the rule differs from the requested host (www vs apex)
- pathType/Prefix vs Exact mismatch or missing rewrite
- Ingress in another namespace from the Service it references
⚡ Quick fix
- kubectl get ingress -A and check CLASS and HOSTS
- Request with the exact host: curl -H 'Host: app.example.com'
- Check controller logs for the request
Detailed fix by platform
YAML
- bash
spec: ingressClassName: nginx rules: - host: app.example.com http: paths: - path: / pathType: Prefix backend: { service: { name: web, port: { number: 80 } } }
How to diagnose
- Class — ingressClassName matches the controller?
- Host — Exact match?
- Logs — kubectl logs -n ingress-nginx deploy/ingress-nginx-controller
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Kubernetes
- error converting YAML to JSON error converting YAML to JSON: yaml: line 12: did not find expected key
- is waiting to start Error from server (BadRequest): container "x" in pod "y" is waiting to start: ContainerCreating
- kubectl connection refused kubectl: The connection to the server localhost:8080 was refused — did you specify the right host or port?
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026