# Kubernetes NGINX Ingress Controller - how to have all default errors go to my defaultBackend?

**URL:** <https://discuss.kubernetes.io/t/kubernetes-nginx-ingress-controller-how-to-have-all-default-errors-go-to-my-defaultbackend/25752>\
**Category:** General Discussions\
**Created:** [October 17, 2023, 5:53pm UTC](https://discuss.kubernetes.io/t/kubernetes-nginx-ingress-controller-how-to-have-all-default-errors-go-to-my-defaultbackend/25752 "2023-10-17T17:53:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![benjamin.lei](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@benjamin.lei](https://discuss.kubernetes.io/u/benjamin.lei)\
**Post date:** [October 17, 2023, 5:53pm UTC](https://discuss.kubernetes.io/t/kubernetes-nginx-ingress-controller-how-to-have-all-default-errors-go-to-my-defaultbackend/25752/1 "2023-10-17T17:53:14Z")

</div>

Hello, I’m trying to use the Kubernetes ingress controller ([GitHub - kubernetes/ingress-nginx: Ingress NGINX Controller for Kubernetes](https://github.com/kubernetes/ingress-nginx)) and have tried to setup a defaultBackend with helm.

While it does look like 404 pages are responding with my custom defualtBackend, I’m noticing that unhandled 5xx+ (and potentially others) pages are still returning with the default ingress controller’s error pages… any idea on how I can have all 400+ default error pages point to my defaultBackend?

Example values file:

```auto
defaultBackend:
  enabled: true
  image:
    repository: my-custom-default-backend
    tag: "latest"
    pullPolicy: Always
    readOnlyRootFilesystem: false
  port: 8080

```

Example ingress resource where I tried an invalid configuration to try and see my default backend (but it didn’t show it):

```auto
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: blei-test-ingress
  namespace: default
  annotations:
    nginx.ingress.kubernetes.io/auth-response-headers: Authorization,Cookie
    nginx.ingress.kubernetes.io/auth-url: https://google.com
spec:
  ingressClassName: nginx-ingress
  rules:
    - host: hello.localdev.me
      http:
        paths:
          - path: /
            pathType: ImplementationSpecific
            backend:
              service:
                name: invalid-service
                port:
                  number: 8080

```

### Cluster information:

Kubernetes version: 1.27.2  
Cloud being used: (put bare-metal if not on a public cloud)  
Installation method: Docker Desktop  
Host OS: OSX  
CNI and version:  
CRI and version:

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.
