# donlon/cloudflare-error-page

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/donlon-cloudflare-error-page).**

5,266 stars · 280 forks · HTML · mit

## Links

- GitHub: https://github.com/donlon/cloudflare-error-page
- Homepage: https://virt.moe/cferr/editor/
- awesome-repositories: https://awesome-repositories.com/repository/donlon-cloudflare-error-page.md

## Description

This project is an HTML renderer that produces error pages styled after the familiar design of a standard CDN provider (such as Cloudflare). It accepts customizable parameters for error code, description, location, and request metadata, and outputs a self-contained HTML page that can be served directly by web servers or reverse proxies as a branded error response.

The renderer is built using Go templates with built-in injection prevention, and it embeds all styling inline within the HTML head to eliminate external dependencies. It applies automatic whitespace minification to reduce output size, and it uses a static status code lookup table to provide appropriate titles, descriptions, and icons for common HTTP errors. Configuration is handled through typed struct fields with validation constraints, ensuring safe input before rendering.

Beyond CDN-style pages, the tool supports generating custom error pages with configurable status codes and messages, making it applicable for static site error handling and web server error page customization. The output is a plain HTML file suitable for any environment that needs a consistent, branded error display.

## Tags

### Software Engineering & Architecture

- [CDN Error Page Renderers](https://awesome-repositories.com/f/software-engineering-architecture/error-handling/error-page-templates/cdn-error-page-renderers.md) — Generates HTML error pages styled after standard CDN error pages with customizable fields.
- [Error Page Templates](https://awesome-repositories.com/f/software-engineering-architecture/error-handling/error-page-templates.md) — Provides customizable HTML error page templates styled after CDN designs. ([source](https://virt.moe/cferr/examples/working))
- [CDN-Style](https://awesome-repositories.com/f/software-engineering-architecture/error-handling/error-page-templates/cdn-style.md) — Creates error pages that visually mimic a CDN provider's design for consistent user experience.

### Part of an Awesome List

- [HTML Builders](https://awesome-repositories.com/f/awesome-lists/devtools/html-builders.md) — Builds configurable HTML error pages with support for multiple status codes and metadata.

### Networking & Communication

- [HTTP Status Code Lookups](https://awesome-repositories.com/f/networking-communication/communication-protocols-architectures/request-processing-architectures/response-handling/http-status-code-lookups.md) — Maps numeric HTTP status codes to titles, descriptions, and icons for error page content.

### Web Development

- [CSS Inlining](https://awesome-repositories.com/f/web-development/css-inlining.md) — Embeds all styling inline within the HTML head to eliminate external dependencies.
- [Error Pages](https://awesome-repositories.com/f/web-development/page-routing-configurations/error-pages.md) — Generates custom error pages with configurable status codes, location, and messages. ([source](https://virt.moe/cferr/editor/))
- [Static Site Error Pages](https://awesome-repositories.com/f/web-development/static-site-error-pages.md) — Produces styled error pages for static site deployments with support for common HTTP errors.

### User Interface & Experience

- [Go Template Renderers](https://awesome-repositories.com/f/user-interface-experience/layout-utilities/presentation-engines/template-engines/server-side-rendering-engines/html-template-renderers/go-template-renderers.md) — Provides Go template rendering with automatic injection prevention for error page generation.
