https://github.com/pascaliske/docker-traefik-errors
Custom error pages for your traefik installation.
https://github.com/pascaliske/docker-traefik-errors
docker traefik traefik-middleware
Last synced: 3 months ago
JSON representation
Custom error pages for your traefik installation.
- Host: GitHub
- URL: https://github.com/pascaliske/docker-traefik-errors
- Owner: pascaliske
- License: mit
- Created: 2021-06-24T10:10:14.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-12T19:06:24.000Z (4 months ago)
- Last Synced: 2025-03-21T17:23:54.654Z (4 months ago)
- Topics: docker, traefik, traefik-middleware
- Language: HTML
- Homepage: https://pascaliske.github.io/docker-traefik-errors/
- Size: 2.96 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# [`pascaliske/docker-traefik-errors`](https://pascaliske.github.io/docker-traefik-errors/)
> Custom error pages for your traefik installation.
[](https://hub.docker.com/r/pascaliske/traefik-errors) [](https://hub.docker.com/r/pascaliske/traefik-errors) [](https://hub.docker.com/r/pascaliske/traefik-errors) [](https://github.com/pascaliske/docker-traefik-errors) [](https://github.com/pascaliske/docker-traefik-errors/actions) [](https://github.com/pascaliske/docker-traefik-errors) [](https://opensource.org/licenses/MIT) [](https://github.com/Naereen/badges)
## Image
| Registry | Image |
| ---------- | ------------------------------------------------------------------------------------------------------------------------ |
| Docker Hub | [`pascaliske/traefik-errors`](https://hub.docker.com/r/pascaliske/traefik-errors) |
| GitHub | [`ghcr.io/pascaliske/traefik-errors`](https://github.com/pascaliske/docker-traefik-errors/pkgs/container/traefik-errors) |The following platforms are available for this image:
```bash
$ 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`:
```yaml
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:
```yaml
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](https://charts.pascaliske.dev/charts/traefik-errors/?utm_source=GitHub&utm_medium=Repository&utm_campaign=docker-traefik-errors)!
## License
[MIT](LICENSE.md) – © 2023 [Pascal Iske](https://pascaliske.dev)