default backend - 404 ☸️ Kubernetes

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

  1. kubectl get ingress -A and check CLASS and HOSTS
  2. Request with the exact host: curl -H 'Host: app.example.com'
  3. Check controller logs for the request

Detailed fix by platform

YAML

  1. bash
    spec:
      ingressClassName: nginx
      rules:
      - host: app.example.com
        http:
          paths:
          - path: /
            pathType: Prefix
            backend: { service: { name: web, port: { number: 80 } } }

How to diagnose

  1. Class — ingressClassName matches the controller?
  2. Host — Exact match?
  3. 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:

🧠 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.