Compare commits

...

2 Commits

Author SHA1 Message Date
Mayel de Borniol b209bbb2d1 attempt using staticresponse 2023-04-10 12:45:19 +12:00
Mayel de Borniol 0a050e5977 attempt at adding error pages 2023-04-10 11:26:59 +12:00
2 changed files with 34 additions and 0 deletions

View File

@ -15,6 +15,9 @@ COMPOSE_FILE="compose.yml"
# General settings #
#####################################################################
## Error pages
COMPOSE_FILE="$COMPOSE_FILE:compose.error-pages.yml"
## Host-mode networking
#COMPOSE_FILE="$COMPOSE_FILE:compose.host.yml"

31
compose.error-pages.yml Normal file
View File

@ -0,0 +1,31 @@
version: '3.8'
services:
app:
command:
- --providers.docker
- --experimental.plugins.staticresponse.modulename=github.com/jdel/staticresponse
- --experimental.plugins.staticresponse.version=v0.0.1
deploy:
labels:
# custom traefik errors
- "traefik.http.middlewares.web-secure.errors.status=400-599"
- "traefik.http.middlewares.web-secure.errors.service=down-rule"
- "traefik.http.middlewares.web-secure.errors.query=/traefik-http-error/{status}"
# catchall rule
- "traefik.http.routers.http-catchall.entrypoints=web-secure"
- "traefik.http.routers.http-catchall.rule=PathPrefix(`/`)"
# lowest possible priority, evaluated when no other router is matched
- "traefik.http.routers.http-catchall.priority=1"
- "traefik.http.routers.http-catchall.middlewares=503down"
# static error message
- "traefik.http.middlewares.503down.plugin.staticresponse"
- "traefik.http.middlewares.503down.plugin.staticresponse.StatusCode=503"
- "traefik.http.middlewares.503down.plugin.staticresponse.Body=Sorry, currently under maintenance. Please try again later."
# error page
- "traefik.http.routers.down-rule.rule=PathPrefix(`/traefik-http-error`)"
- "traefik.http.routers.down-rule.service=noop@internal"
- "traefik.http.routers.down-rule.entrypoints=web-secure"
- "traefik.http.routers.down-rule.middlewares=503down"