tarampampam / error-pages

🚧 Pretty server's error pages in the docker image & git repository (for traefik, k8s, nginx and so on)
https://tarampampam.github.io/error-pages/
MIT License
792 stars 78 forks source link

Custom 404 page #224

Open r10513 opened 9 months ago

r10513 commented 9 months ago

Is there an existing issue for this?

Describe the problem to be solved

First of all thank you for your wonderful package! I would like to use your pages (for instance, the l7-dark template) but with a custom 404 page.

Suggest a solution

Would it be possible to implement an environmental variable, such as CUSTOM_404 that, if not set, has a default to False? Then, in the docker container, is just a matter to set CUSTOM_404 to true and implement the correct mapping via a volume entry.. Something like

  error-pages:
    image: tarampampam/error-pages:latest
    ports:
      - 8080:8080
    volumes:
      - /path/to/local/404.html:/custom/404.html:ro
    environment:
      TEMPLATE_NAME: l7-dark
      CUSTOM_404:  true
    labels:
      traefik.enable: true

Thank you!

Additional context

No response

tarampampam commented 2 weeks ago

Hello and thank you for raising this issue! May I ask why you chose to override only one (or a few) error pages, instead of creating a custom template to cover all error codes? What is the reason for using a custom template for only one specific code? I am asking because I am currently working on a new major version of the error-pages and would like to understand the reasoning behind this approach to determine if it should be implemented in a new version.