Custom error pages for Nginx ingress Controller.
- Clone repo
- Replace www folder with your error pages.
- Docker build and push
Use Docker image: pavansh/custom-error-pages
- Replace default-http-backend image with pavansh/custom-error-pages .
- Change default-http-backend service with targetPort 80.
or create new deployment
kubectl apply -f https://raw.githubusercontent.com/pavansh/custom-error-pages/master/k8s/deployment.yaml
kubectl apply -f https://raw.githubusercontent.com/pavansh/custom-error-pages/master/k8s/service.yaml
-
Edit the nginx-ingress-controller Deployment and set the value of the --default-backend flag to the name of the newly created error backend
-
Edit the nginx-configuration ConfigMap and create the key custom-http-errors with a value of 404,500,502,503