Sign inSign up

kohenkatz/traefik-error-pages

By kohenkatz

•Updated about 5 years ago

Image
0

508

kohenkatz/traefik-error-pages repository overview

⁠traefik-error-pages

A simple Go server for Traefik⁠'s ErrorPage⁠ middleware.

Page design and content based on https://github.com/HttpErrorPages/HttpErrorPages⁠.

Inspired by similar work by Guillaume Briday⁠ and Prasad Tengse⁠.

⁠Setup Instructions

⁠Set up a container running this project in your docker-compose.yml
errorpage:
  restart: unless-stopped
  image: kohenkatz/traefik-error-pages:latest
  labels:
    - traefik.enable=true
    - traefik.http.routers.errorpage.entrypoints=websecure
    - "traefik.http.routers.errorpage.rule=HostRegexp(`{host:.+}`)"
    - traefik.http.services.errorpage.loadbalancer.server.port=3000
    - traefik.http.middlewares.errorpage.errors.status=400-599
    - traefik.http.middlewares.errorpage.errors.service=errorpage
    - traefik.http.middlewares.errorpage.errors.query=/HTTP{status}.html
    # Don't show the root file list
    - "traefik.http.middlewares.no-index.replacepathregex.regex=^/$$"
    - "traefik.http.middlewares.no-index.replacepathregex.replacement=/HTTP404.html"
    - traefik.http.routers.errorpage.middlewares=no-index
⁠Tell your other containers to use this one for error pages
⁠Individually per-service
- traefik.http.routers.myapplication.middlewares=errorpage

Use commas to separate multiple middlewares:

- traefik.http.routers.myapplication.middlewares=securityHeaders@file,errorpage
⁠Globally per entrypoint
[entryPoints]
  [entryPoints.websecure]
    address = ":443"
    [entryPoints.websecure.http]
      middlewares = ["errorpage@docker"]

⁠Build Instructions

This project is published to Docker Hub⁠ and GitHub Containers⁠.

docker buildx build \
    --platform linux/amd64,linux/arm64 \
    --tag kohenkatz/traefik-error-pages:latest \
    --tag ghcr.io/kohenkatz/traefik-error-pages:latest \
    --push \
    .

In order to use the command above, you must be logged into Docker Hub and GitHub Containers.

Tag summary

Content type

Image

Digest

Size

11.7 MB

Last updated

about 5 years ago

docker pull kohenkatz/traefik-error-pages