[go: up one dir, main page]

Skip to content

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

License

Notifications You must be signed in to change notification settings

ramesaliyev/default-backend

 
 

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

The only reason for creating this project was to customize the 404 page. I went with retro TV static (generated entirely with HTML canvas and CSS animations).

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 jshimko/default-backend:1.0.0 (or your own custom build if you prefer)

helm install \
  --name nginx-ingress \
  --set defaultBackend.image.repository=jshimko/default-backend,defaultBackend.image.tag=1.0.0 \
  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 default-backend .

Run

To test locally:

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

View at http://localhost:8080

License

MIT

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CSS 66.5%
  • JavaScript 22.4%
  • HTML 8.4%
  • Dockerfile 2.7%