I have set up an error-pages middleware using the following compose file:
services:
error-pages:
image: ghcr.io/tarampampam/error-pages:3
environment:
TEMPLATE_NAME: noise
networks:
- traefik
labels:
traefik.enable: true
traefik.http.routers.error-pages-router.rule: HostRegexp(`.+`)
traefik.http.routers.error-pages-router.priority: 1
traefik.http.routers.error-pages-router.entrypoints: web
traefik.http.routers.error-pages-router.middlewares: error-pages-middleware
traefik.http.middlewares.error-pages-middleware.errors.status: 400-599
traefik.http.middlewares.error-pages-middleware.errors.service: error-pages-service
traefik.http.middlewares.error-pages-middleware.errors.query: /{status}.html
traefik.http.services.error-pages-service.loadbalancer.server.port: 8080
networks:
public:
external: true
traefik:
external: true
with the corresponding section in traefik.yml to automatically attach it to all traefik-managed containers:
entryPoints:
web:
address: :80
http:
middlewares:
- error-pages-middleware@docker
websecure:
address: :443
http:
middlewares:
- error-pages-middleware@docker
This works totally fine for all services running, except for the traefik service itself. If a container is down, traefik delivers a plain old 404 error page.
I can not for the life of me figure out, why this is the case and i could not find any information online that is about this specific scenario. I hope that there is someone here that could point me in the right direction.
