cloud-platform-custom-error-pages

command module
v0.0.0-...-8faf5a6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2021 License: MIT Imports: 10 Imported by: 0

README

Cloud Platform Custom Error Pages

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

  1. Create your custom HTTP error pages in the rootfs/www folder, following the existing code.format pattern.
  2. Edit the makefile and change the version number of the IMAGE line near the top of the file.
  3. Run make all to create a new version of the docker image, with your custom error pages.
  4. Run make push to tag and push the image to docker hub.
  5. Use run.sh to run the image locally, and call.sh to 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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL