Skip to content

goto10hq/NoizyDefaultBackend

Repository files navigation

Default backend for nginx-ingress on Kubernetes

This is a custom default backend for nginx-ingress. The purpose of this as stated in their readme:

The default backend is a service which handles all url paths and hosts that the nginx controller doesn't understand (i.e., all requests that are not mapped with an Ingress).

Basically a default backend exposes two URLs:

  • / that returns 404
  • /healthz that returns 200

404-example

Usage on Kubernetes

The easiest way to use this is by using the nginx-ingress Helm chart. When you deploy the chart, set the image values for the default backend Docker image to goto10hq/noizy-default-backend:1.1.1

helm install \
  --name nginx-ingress \
  --set defaultBackend.image.repository=goto10hq/noizy-default-backend,defaultBackend.image.tag=1.1.1 \  
  stable/nginx-ingress

Then any time someone goes to a hostname or url that Nginx doesn't recognize, you will see the above 404 page.

Build

If you'd like to customize this project and create your own build, edit the code and...

docker build -t noizy-default-backend .

Run

To test locally:

docker run -d -p 8080:8080 noizy-default-backend

View at http://localhost:8080

Acknowledgement

default-backend by jshimko

License

MIT

About

A default backend (404 page) for nginx-ingress in Kubernetes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published