error-pages icon indicating copy to clipboard operation
error-pages copied to clipboard

Custom 404 page

Open r10513 opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

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

r10513 avatar Sep 15 '23 14:09 r10513

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.

tarampampam avatar Jun 24 '24 15:06 tarampampam