Sign inSign up

guillaumebriday/traefik-custom-error-pages

By guillaumebriday

•Updated over 6 years ago

Image
6

1M+

guillaumebriday/traefik-custom-error-pages repository overview

Donate Docker Pulls Docker Stars Netlify Status

⁠Custom error pages for Traefik

A bunch of custom error pages for Traefik built with Jekyll⁠.

⁠Development

Install dependencies

$ bundle install

If you want to build the project on your host:

$ jekyll build

If you want to preview the pages before building the Docker image :

$ jekyll serve

Open http://127.0.0.1:4000/⁠.

⁠How to use with Traefik and Docker in Production

Run the container with labels, change with your needs:

# docker-compose.yml

errorpage:
  image: guillaumebriday/traefik-custom-error-pages
  restart: unless-stopped
  networks:
    - web
  labels:
    - traefik.enable: "true"
    - traefik.docker.network: "web"
    - traefik.http.routers.errorpage.entrypoints: "websecure"
    - traefik.http.routers.errorpage.rule: "HostRegexp(`{host:.+}`)"
    - traefik.http.services.globalerrorpage.loadbalancer.server.port: "80"

⁠Build the image

This is a multi-stage build⁠, to build the final image:

$ docker build -f .cloud/docker/Dockerfile -t traefik-custom-error-pages .

⁠How it works?

As you can see in the Dockerfile, I use Nginx⁠ as Web server to serve static files. To generate this pages, I use Jekyll⁠ in the first step of the build.

You will find in this article https://www.techjunktrunk.com/docker/2017/11/03/traefik-default-server-catch-all⁠ why I set up rule this way.

It's very useful because this container will respond to all requests only if there is no container with a real rule.

⁠Credits

I used the Laravel⁠ default HTTP error pages.

⁠Contributing

Do not hesitate to contribute to the project by adapting or adding features ! Bug reports or pull requests are welcome.

⁠License

This project is released under the MIT⁠ license.

Tag summary

Content type

Image

Digest

Size

9 MB

Last updated

over 6 years ago

docker pull guillaumebriday/traefik-custom-error-pages