# Custom error pages with traefik v2

**URL:** <https://community.traefik.io/t/custom-error-pages-with-traefik-v2/2800>\
**Category:** Traefik v2\
**Tags:** file\
**Created:** [November 5, 2019, 12:41pm UTC](https://community.traefik.io/t/custom-error-pages-with-traefik-v2/2800 "2019-11-05T12:41:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lachnerd](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/lachnerd/32/1056_2.png) [@lachnerd](https://community.traefik.io/u/lachnerd)\
**Post date:** [November 5, 2019, 12:41pm UTC](https://community.traefik.io/t/custom-error-pages-with-traefik-v2/2800/1 "2019-11-05T12:41:29Z")

</div>

Hi,  
im running custom error pages on my traefik v1 services.  
So i wanted to implement that also with traefik v2 but i don't get it working.

Does someone has an example using and defining a custom error page service with Version 2 ?

---

<div class="post-metadata">

**Author:** ![dduportal](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/dduportal/32/4_2.png) [@dduportal](https://community.traefik.io/u/dduportal)\
**Post date:** [November 5, 2019, 12:52pm UTC](https://community.traefik.io/t/custom-error-pages-with-traefik-v2/2800/2 "2019-11-05T12:52:19Z")

</div>

Hi @lachnerd, can you share the configurations with us so we can help you?

---

<div class="post-metadata">

**Author:** ![lachnerd](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/lachnerd/32/1056_2.png) [@lachnerd](https://community.traefik.io/u/lachnerd)\
**Post date:** [November 5, 2019, 1:42pm UTC](https://community.traefik.io/t/custom-error-pages-with-traefik-v2/2800/3 "2019-11-05T13:42:28Z")

</div>

Sure,  
but i got it working now (don't know the reason maybe a typo or something else) but maybe it helps others.

I have a service servingh the error pages defined in rancher with following labels:

```auto
# errorhandler@rancher
labels:
      traefik.http.services.errorhandler.loadbalancer.server.port: '80'
      traefik.enable: 'true'
      #only for testing
      traefik.http.routers.errorhandler.rule: Host(`error.domain.com`)
      io.rancher.container.pull_image: always
      traefik.http.routers.nginx.entrypoints: web

```

In a file provided dynamic\_conf.toml i defined the middleware

```auto
# errortest@file
[http.middlewares]
  [http.middlewares.errortest.errors]
       status = ["400-404","405","500","502-504"]
       service = "errorhandler@rancher"
       query = "/{status}.html"

```

the app that uses custom error pages simply uses the middleware with another label:

```auto
# simpleapp@rancher
labels:
  traefik.http.routers.simpleapp.middlewares: errortest@file

```
