ErrorPage

    The ErrorPage middleware returns a custom page in lieu of the default, according to configured ranges of HTTP Status codes.

    Important

    The error page itself is not hosted by Traefik.

    1. kind: Middleware
    2. metadata:
    3. name: test-errorpage
    4. errors:
    5. status:
    6. - 500-599
    7. query: /{status}.html
    8. service:
    9. name: whoami
    10. port: 80

    1. "traefik.http.middlewares.test-errorpage.errors.status": "500-599",
    2. "traefik.http.middlewares.test-errorpage.errors.query": "/{status}.html"
    3. }

    1. # Custom Error Page for 5XX
    2. [http.middlewares]
    3. [http.middlewares.test-errorpage.errors]
    4. status = ["500-599"]
    5. service = "serviceError"
    6. query = "/{status}.html"
    7. # ... definition of error-handler-service and my-service

    Configuration Options

    The status that will trigger the error page.

    The status code ranges are inclusive (500-599 will trigger with every code between 500 and 599, 500 and 599 included).

    You can define either a status code like 500 or ranges with a syntax like 500-599.

    The service that will serve the new requested error page.

    In kubernetes, you need to reference a kubernetes service instead of a traefik service.