-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Description
Do you want to request a feature or report a bug?
feature
What did you do?
Configured custom error pages according to Docker backend instructions, here
What did you expect to see?
Expected to see requests for erroring back-ends being re-routed to a separate back-end that servers custom error pages.
What did you see instead?
There are three issues here, two of which are simple updates to docs (I'll submit a pull request), but the third I'm unable to solve, and after reviewing the docs and source, I'm lead to think is a bug. So here's what I'm proposing:
- The docs here need clarifying. One, they need some examples, showing that, most commonly,
<name>should ==networks, and second, if you link through to the Custom Error Pages docs, it gives the error name asnetwork(i.e.frontends.website.errors.network), when it should befrontends.website.errors.networks(plural) - The docs should explicitly mention that this feature is available only in 1.6 and above – if you pull
traefik:latestat the moment, you don't get this version - If you've resolved (1) and (2) above, and set up the configuration below, you get an error in your error log:
level=error msg="Error Page is configured for Frontend frontend-Host-localhost-1, but either Backend error is not set or Backend URL is missing". This is either a bug, or there's additional documentation that needs to be added to show how to make this work. I've scoured the docs and the source and can't work out what's going wrong.
I'm hoping that this is acceptable as an issue rather than a support request as I'll use this as the basis for a PR for the docs once I've got it figured out. I hope this is a valuable contribution as, though I don't write golang, I care deeply about this project and want to make it easier to use for other Docker users like me!
N.B. I started this as a SO issue
Output of traefik version: (What version of Traefik are you using?)
Version: v1.6.0-rc4
Codename: tetedemoine
Go version: go1.10.1
Built: 2018-04-04_01:40:48PM
OS/Arch: linux/amd64
What is your environment & configuration (arguments, toml, provider, platform, ...)?
defaultEntryPoints = ["http"]
# [accessLog]
# logLevel = "DEBUG"
# Enable API and dashboard
[api]
dashboard = true
[entryPoints]
[entryPoints.http]
address = ":80"
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "localhost"
watch = true
exposedbydefault = truedocker-compose.yml
version: '2'
services:
traefik:
image: traefik:1.6.0-rc4
ports:
- "80:80"
- "8080:8080"
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./acme:/etc/traefik/acme/
- ./traefik.toml:/etc/traefik/traefik.toml
error:
image: kitematic/hello-world-nginx
ports:
- "80"
volumes:
- ./html:/website_files
labels:
- "traefik.backend=error"
- "traefik.port=80"
- "traefik.frontend.rule=Host:error.localhost"
- "traefik.enable=true"
hello:
image: kitematic/hello-world-nginx
ports:
- "80"
depends_on:
- "error"
labels:
- traefik.backend=hello
- traefik.backend.url=http://hello
- traefik.port=801
- traefik.frontend.rule=Host:localhost
- traefik.enable=true
- traefik.frontend.errors.networks.status=[500-599]
- traefik.frontend.errors.networks.backend=error
- traefik.frontend.errors.networks.query=/500s.html