Cloud Platform Custom Error Pages
October 17, 2025 ยท View on GitHub
This repo creates a docker image containing custom HTTP error pages, to be used as per these instructions.
A default-backend is served by nginx as a fall-back. This is typically when the sub-domain, for example https://wrongdomain.cloud-platform.service.justice.gov.uk/, isn't recognized. Otherwise, the default nginx page would show, which doesn't look professional.
This is a simplified version of the kubernetes/ingress-nginx example.
Usage
- Create your custom HTTP error pages in the
rootfs/wwwfolder, following the existingcode.formatpattern. - Edit the
makefileand change the version number of theIMAGEline near the top of the file. - Run
make allto create a new version of the docker image, with your custom error pages. - Run
make pushto tag and push the image to docker hub. - Use
run.shto run the image locally, andcall.shto send http requests for the different error pages.
NB: This image can only respond with a single HTML file. So, if you want your custom error page to use other assets such as images, fonts, stylesheets, etc. you need to ensure that those are available at some fixed URLs, and hard-code those URLs into your error pages.
Installation in a Kubernetes cluster
Update the defaultBackend config in the nginx-ingress-acme.tf, with the docker image created above containing custom HTTP error pages.
defaultBackend:
enabled: true
name: default-backend
image:
repository: ministryofjustice/cloud-platform-custom-error-pages
tag: "0.3"
pullPolicy: IfNotPresent
extraArgs: {}
port: 8080
Cutting a new release
Upon applying updates to this repo and or Dockerfile, create a new release. This will trigger a GitHub action to build and push a new image to Docker Hub with the tag matching the release version.
You'll also need to update the image tag ref in run.sh to match the new version.