Sign inSign up

zachbg/docker-error-pages

By zachbg

•Updated 6 months ago

Beautiful branded error pages (502, 503, 404) with auto-refresh

Image
1

1.7K

zachbg/docker-error-pages repository overview

⁠Docker Error Pages

Beautiful, customizable error pages for reverse proxies. Replace ugly default 502/503/404 pages with professional, branded pages that auto-refresh.

⁠Why?

When your backend crashes, users see "502 Bad Gateway" in plain text. It looks broken. It is broken. But it doesn't have to look broken. Error pages give your users confidence that you're aware of the issue and working on it — with auto-refresh so they don't have to mash F5.

⁠Quick Start

services:
  error-pages:
    image: zachbg/docker-error-pages:latest
    restart: unless-stopped
    environment:
      BRAND_NAME: "My Company"
      BRAND_URL: "https://mycompany.com"
⁠With Traefik
services:
  error-pages:
    image: zachbg/docker-error-pages:latest
    labels:
      traefik.enable: "true"
      traefik.http.services.error-pages.loadbalancer.server.port: 8080

  traefik:
    image: traefik:v3
    command:
      - "--providers.docker=true"
      - "--entrypoints.web.address=:80"
    labels:
      traefik.http.middlewares.error-pages.errors.status: "400-599"
      traefik.http.middlewares.error-pages.errors.service: error-pages
      traefik.http.middlewares.error-pages.errors.query: "/{status}"
⁠With Nginx
proxy_intercept_errors on;
error_page 502 503 504 @error;

location @error {
    proxy_pass http://error-pages:8080/$status;
}
⁠With Caddy
handle_errors {
    rewrite * /{err.status_code}
    reverse_proxy error-pages:8080
}

⁠Environment Variables

VariableDefaultDescription
THEMEmodernVisual theme
BRAND_NAMEServiceYour company/service name
BRAND_URL/Homepage URL
SUPPORT_EMAILSupport email to display
CUSTOM_CSSAdditional CSS to inject

⁠Included Error Pages

CodeTitleFeatures
401UnauthorizedLogin redirect button
403ForbiddenContact admin prompt
404Not FoundSearch suggestion
429Too Many RequestsCountdown timer + auto-retry
500Internal Server ErrorTeam notified message
502Bad GatewayAuto-refresh (30s)
503Service UnavailableSpinner + auto-refresh (15s)
504Gateway TimeoutAuto-refresh (30s)

⁠Custom Pages

Mount your own HTML files to override defaults:

volumes:
  - ./my-404.html:/usr/share/nginx/error-pages/404.html
  - ./my-503.html:/usr/share/nginx/error-pages/503.html

⁠URL Pattern

Access error pages directly by status code:

  • http://error-pages:8080/404
  • http://error-pages:8080/502
  • http://error-pages:8080/503

This makes integration with any reverse proxy trivial.

Tag summary

Content type

Image

Digest

sha256:ed46b7091…

Size

25.4 MB

Last updated

6 months ago

docker pull zachbg/docker-error-pages