Code Monkey home page Code Monkey logo

docker-traefik-errors's Introduction

Custom error pages for your traefik installation.

Docker Image Version (tag latest semver) Docker Image Size (tag) Docker Pulls GitHub Tag Build Status GitHub Last Commit License: MIT Awesome Badges

Image

Registry Image
Docker Hub pascaliske/traefik-errors
GitHub ghcr.io/pascaliske/traefik-errors

The following platforms are available for this image:

$ docker run --rm mplatform/mquery pascaliske/traefik-errors:latest
Image: pascaliske/traefik-errors:latest
 * Manifest List: Yes
 * Supported platforms:
   - linux/amd64
   - linux/arm/v7
   - linux/arm64

Usage

To use the error pages you have to do these two steps:

1. Setup error service

The easiest way to use the service is docker-compose:

version: '3.7'
services:
  # proxy
  traefik:
    image: traefik:latest
    container_name: traefik
    ports:
      - '80:80'
    command:
      - --providers.docker=true
      - --providers.docker.exposedbydefault=false
      - --entrypoints.http.address=:80
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /path/to/traefik/config:/etc/traefik

  # custom error pages
  traefik-errors:
    image: ghcr.io/pascaliske/traefik-errors:latest # or: pascaliske/traefik-errors:latest
    container_name: traefik-errors
    labels:
      - traefik.enable=true
      - traefik.http.routers.traefik-errors.rule=HostRegexp(`{host:.+}`)
      - traefik.http.routers.traefik-errors.entrypoints=http
      - traefik.http.routers.traefik-errors.priority=1
      - traefik.http.routers.traefik-errors.middlewares=error-pages@file

  # demo service
  whoami:
    image: traefik/whoami
    container_name: whoami
    labels:
      - traefik.enable=true
      - traefik.http.routers.whoami.rule=Host(`whoami.domain.tld`)
      - traefik.http.routers.whoami.entrypoints=http
      - traefik.http.routers.whoami.middlewares=error-pages@file

2. Configure traefik middleware

Create a dynamic config file for traefik:

http:
  middlewares:
    error-pages:
      errors:
        service: traefik-errors
        query: "/?code={status}&home=domain.tld" # home parameter is optional
        status:
          - 400-599

Kubernetes

If you want to use this tool inside of a Kubernetes cluster check out my ready to deploy Helm chart!

License

MIT โ€“ ยฉ 2023 Pascal Iske

docker-traefik-errors's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar pascaliske avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

docker-traefik-errors's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
Dockerfile
  • node 20-alpine
  • node 20-alpine
  • nginx 1.25.4-alpine
github-actions
.github/workflows/docs.yml
  • actions/checkout v4
  • arduino/setup-task v1
  • mhausenblas/mkdocs-deploy-gh-pages 1.26
.github/workflows/image.yml
  • actions/checkout v4
  • actions/setup-node v4
  • docker/setup-qemu-action v3
  • docker/metadata-action v5
  • docker/setup-buildx-action v3
  • docker/login-action v3
  • docker/login-action v3
  • docker/build-push-action v5
  • ncipollo/release-action v1
  • actions/checkout v4
  • crazy-max/ghaction-container-scan v3
  • github/codeql-action v3
.github/workflows/labels.yml
  • actions/checkout v4
  • crazy-max/ghaction-github-labeler v5
npm
package.json
  • @angular/animations ^17.1.1
  • @angular/common ^17.1.1
  • @angular/compiler ^17.1.1
  • @angular/core ^17.1.1
  • @angular/forms ^17.1.1
  • @angular/platform-browser ^17.1.1
  • @angular/platform-browser-dynamic ^17.1.1
  • @angular/platform-server ^17.1.1
  • @angular/router ^17.1.1
  • @angular/ssr ^17.1.1
  • express ^4.18.2
  • http-status-codes ^2.2.0
  • ngx-progressbar ^11.0.0
  • rxjs ~7.8.0
  • tslib ^2.4.1
  • zone.js ~0.14.0
  • @angular-devkit/build-angular ^17.1.1
  • @angular-eslint/builder ^18.0.0
  • @angular-eslint/eslint-plugin ^18.0.0
  • @angular-eslint/eslint-plugin-template ^18.0.0
  • @angular-eslint/schematics ^18.0.0
  • @angular-eslint/template-parser ^18.0.0
  • @angular/cli ^17.1.1
  • @angular/compiler-cli ^17.1.1
  • @commitlint/cli ^19.0.0
  • @commitlint/config-conventional ^19.0.0
  • @pascaliske/eslint-config ^3.0.0
  • @pascaliske/prettier-config ^1.2.0
  • @rstacruz/bump-cli ^2.0.1
  • @types/express ^4.17.16
  • @types/node ^20.0.0
  • @typescript-eslint/eslint-plugin ^7.0.0
  • @typescript-eslint/parser ^7.0.0
  • browser-sync ^3.0.0
  • eslint ^9.0.0
  • husky ^9.0.0
  • prettier ^3.0.0
  • standard-changelog ^6.0.0
  • ts-node ^10.9.1
  • typescript ~5.3.3
  • ts-node ^10.9.1

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.