[GH-ISSUE #1044] Dedicated Error Page #14618

Closed
opened 2026-05-16 02:31:12 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @nurhalim88 on GitHub (Jul 10, 2025).
Original GitHub issue: https://github.com/fosrl/pangolin/issues/1044

Originally assigned to: @miloschwartz on GitHub.

For common errors like 404, 500 or Internal Server Error it would be better to redirect to a dedicated error page. It looks nicer and is better than just displaying a plain "404 page not found" or "Internal Server Error" message.

You (Browser) Working <-> Proxy (Pangolin) Working <-> Host (something.com) Error

Below is the sample, thanks.

Image
Originally created by @nurhalim88 on GitHub (Jul 10, 2025). Original GitHub issue: https://github.com/fosrl/pangolin/issues/1044 Originally assigned to: @miloschwartz on GitHub. For common errors like 404, 500 or Internal Server Error it would be better to redirect to a dedicated error page. It looks nicer and is better than just displaying a plain "404 page not found" or "Internal Server Error" message. You (Browser) Working ✅ <-> Proxy (Pangolin) Working ✅ <-> Host (something.com) Error ❌ Below is the sample, thanks. <img width="1897" height="881" alt="Image" src="https://github.com/user-attachments/assets/a078a6a1-dbcd-44c0-8136-e45e3c5b0dbd" />
GiteaMirror added the documentationenhancement labels 2026-05-16 02:31:12 -05:00
Author
Owner

@oschwartz10612 commented on GitHub (Jul 10, 2025):

We actually have a POC of this working internally and could release some instructions for it sometime soon!

<!-- gh-comment-id:3058210849 --> @oschwartz10612 commented on GitHub (Jul 10, 2025): We actually have a POC of this working internally and could release some instructions for it sometime soon!
Author
Owner

@miloschwartz commented on GitHub (Jul 12, 2025):

Yeah we can work on docs for this. We've played around with this tool: https://github.com/tarampampam/error-pages?tab=readme-ov-file

Pretty easy to set up and use

<!-- gh-comment-id:3064666563 --> @miloschwartz commented on GitHub (Jul 12, 2025): Yeah we can work on docs for this. We've played around with this tool: https://github.com/tarampampam/error-pages?tab=readme-ov-file Pretty easy to set up and use
Author
Owner

@MorganKryze commented on GitHub (Jul 31, 2025):

That would be a pretty nice feature! I tried it on a separate server and got it working pretty well. But got an issue with "vanilla" error pages still appearing on 404 pages for services that were down. But once up, those service would deliver proper error pages. Could not figure out why, did you manage to mitigate this issue?

<!-- gh-comment-id:3141410038 --> @MorganKryze commented on GitHub (Jul 31, 2025): That would be a pretty nice feature! I tried it on a separate server and got it working pretty well. But got an issue with "vanilla" error pages still appearing on 404 pages for services that were down. But once up, those service would deliver proper error pages. Could not figure out why, did you manage to mitigate this issue?
Author
Owner

@coolbepps commented on GitHub (Aug 18, 2025):

Yeah we can work on docs for this. We've played around with this tool: https://github.com/tarampampam/error-pages?tab=readme-ov-file

Pretty easy to set up and use

Would you be willing to share some details about how you managed to got it working? I'm having some difficulties and the only thing I managed to achieve was 404'ing all my resources. Thanks in advance!

<!-- gh-comment-id:3196138240 --> @coolbepps commented on GitHub (Aug 18, 2025): > Yeah we can work on docs for this. We've played around with this tool: https://github.com/tarampampam/error-pages?tab=readme-ov-file > > Pretty easy to set up and use Would you be willing to share some details about how you managed to got it working? I'm having some difficulties and the only thing I managed to achieve was 404'ing all my resources. Thanks in advance!
Author
Owner

@coolbepps commented on GitHub (Aug 18, 2025):

I managed to make it work:

  1. Added error-pages container to my docker compose file.
error-pages:
    image: ghcr.io/tarampampam/error-pages:3.5
    environment:
      - TEMPLATE_NAME=connection
  1. Added a new middleware in dynamic_config.yml.
error-pages-middleware:
    errors:
      status: 400-599
      service: error-pages-service
      query: /{status}.html
  1. Added a new router in dynamic_config.yml.
error-pages-router:
      rule: "HostRegexp(`.+`)"
      priority: 10
      service: error-pages-service
      entrypoints:
        - websecure
      middlewares:
        - error-pages-middleware
  1. Added a new service in dynamic_config.yml.
error-pages-service:
      loadBalancer:
        servers:
          - url: "http://error-pages:8080" # Error Pages server

5, Finally, added the middleware to the websecure entrypoint in traefik_config.yml.

entryPoints:
  web:
    address: :80
  websecure:
    address: :443
    http:
      middlewares:
        - crowdsec@file
        - geoblock@file
        - error-pages-middleware@file
      tls:
        certResolver: letsencrypt
    transport:
      respondingTimeouts:
        readTimeout: 30m

So far it seems to work well, I will report if there's any issues I run into.

<!-- gh-comment-id:3197326269 --> @coolbepps commented on GitHub (Aug 18, 2025): I managed to make it work: 1. Added error-pages container to my docker compose file. ``` error-pages: image: ghcr.io/tarampampam/error-pages:3.5 environment: - TEMPLATE_NAME=connection ``` 2. Added a new middleware in `dynamic_config.yml`. ``` error-pages-middleware: errors: status: 400-599 service: error-pages-service query: /{status}.html ``` 3. Added a new router in `dynamic_config.yml`. ``` error-pages-router: rule: "HostRegexp(`.+`)" priority: 10 service: error-pages-service entrypoints: - websecure middlewares: - error-pages-middleware ``` 4. Added a new service in `dynamic_config.yml`. ``` error-pages-service: loadBalancer: servers: - url: "http://error-pages:8080" # Error Pages server ``` 5, Finally, added the middleware to the `websecure` entrypoint in `traefik_config.yml`. ``` entryPoints: web: address: :80 websecure: address: :443 http: middlewares: - crowdsec@file - geoblock@file - error-pages-middleware@file tls: certResolver: letsencrypt transport: respondingTimeouts: readTimeout: 30m ``` So far it seems to work well, I will report if there's any issues I run into.
Author
Owner

@elcajon commented on GitHub (Aug 18, 2025):

I've been tracking this issue for a while and have just tested your solution. Everything works perfectly. Thank you very much! Perhaps this would be worth submitting as a pull request here:
https://github.com/fosrl/docs-v2/tree/main/self-host/community-guides

<!-- gh-comment-id:3197445503 --> @elcajon commented on GitHub (Aug 18, 2025): I've been tracking this issue for a while and have just tested your solution. Everything works perfectly. Thank you very much! Perhaps this would be worth submitting as a pull request here: https://github.com/fosrl/docs-v2/tree/main/self-host/community-guides
Author
Owner

@oschwartz10612 commented on GitHub (Aug 23, 2025):

Yep thats pretty much how we got it to work as well sorry for not
getting back to you in time.

Yeah a guide would be super cool if you want to take a stab at it! :}

I dont feel like we should bake it in quite yet to the default install...

<!-- gh-comment-id:3216265824 --> @oschwartz10612 commented on GitHub (Aug 23, 2025): Yep thats pretty much how we got it to work as well sorry for not getting back to you in time. Yeah a guide would be super cool if you want to take a stab at it! :} I dont feel like we should bake it in quite yet to the default install...
Author
Owner

@jiriteach commented on GitHub (Nov 9, 2025):

I managed to make it work:

  1. Added error-pages container to my docker compose file.
error-pages:
    image: ghcr.io/tarampampam/error-pages:3.5
    environment:
      - TEMPLATE_NAME=connection
  1. Added a new middleware in dynamic_config.yml.
error-pages-middleware:
    errors:
      status: 400-599
      service: error-pages-service
      query: /{status}.html
  1. Added a new router in dynamic_config.yml.
error-pages-router:
      rule: "HostRegexp(`.+`)"
      priority: 10
      service: error-pages-service
      entrypoints:
        - websecure
      middlewares:
        - error-pages-middleware
  1. Added a new service in dynamic_config.yml.
error-pages-service:
      loadBalancer:
        servers:
          - url: "http://error-pages:8080" # Error Pages server

5, Finally, added the middleware to the websecure entrypoint in traefik_config.yml.

entryPoints:
  web:
    address: :80
  websecure:
    address: :443
    http:
      middlewares:
        - crowdsec@file
        - geoblock@file
        - error-pages-middleware@file
      tls:
        certResolver: letsencrypt
    transport:
      respondingTimeouts:
        readTimeout: 30m

So far it seems to work well, I will report if there's any issues I run into.

Hi - I have a quick question. This works however if I want to change the rule so certain domains are excluded, it does not - in fact anything I change the rule to does not work. Any idea what could be causing this?

In my case - since I have Plex - installed proxied - loading this - Plex throws a 401 then redirects to its login screen. The 401 however is being intercepted and show in the custom error so trying to exclude this. Thanks

<!-- gh-comment-id:3507861255 --> @jiriteach commented on GitHub (Nov 9, 2025): > I managed to make it work: > > 1. Added error-pages container to my docker compose file. > > ``` > error-pages: > image: ghcr.io/tarampampam/error-pages:3.5 > environment: > - TEMPLATE_NAME=connection > ``` > > 2. Added a new middleware in `dynamic_config.yml`. > > ``` > error-pages-middleware: > errors: > status: 400-599 > service: error-pages-service > query: /{status}.html > ``` > > 3. Added a new router in `dynamic_config.yml`. > > ``` > error-pages-router: > rule: "HostRegexp(`.+`)" > priority: 10 > service: error-pages-service > entrypoints: > - websecure > middlewares: > - error-pages-middleware > ``` > > 4. Added a new service in `dynamic_config.yml`. > > ``` > error-pages-service: > loadBalancer: > servers: > - url: "http://error-pages:8080" # Error Pages server > ``` > > 5, Finally, added the middleware to the `websecure` entrypoint in `traefik_config.yml`. > > ``` > entryPoints: > web: > address: :80 > websecure: > address: :443 > http: > middlewares: > - crowdsec@file > - geoblock@file > - error-pages-middleware@file > tls: > certResolver: letsencrypt > transport: > respondingTimeouts: > readTimeout: 30m > ``` > > So far it seems to work well, I will report if there's any issues I run into. Hi - I have a quick question. This works however if I want to change the rule so certain domains are excluded, it does not - in fact anything I change the rule to does not work. Any idea what could be causing this? In my case - since I have Plex - installed proxied - loading this - Plex throws a 401 then redirects to its login screen. The 401 however is being intercepted and show in the custom error so trying to exclude this. Thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/pangolin#14618