Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Custom Cloudflare Error Pages

A set of well-designed and crafted custom Cloudflare error pages.

Pull Requests Issues License

Introduction

A set of well-designed and crafted HTML error pages for customizing Cloudflare error pages.

Each folder in this repository is a theme, and each theme contains a complete set of error pages.

(Customizing error pages is only available for Cloudflare paid plans)

Themes

Paperize Geometry
paperize-preview geometry-preview

Installation

Manual

Go to https://dash.cloudflare.com/<account-id>/<domain>/error-pages and update the custom error pages one by one.

Create

Cloudflare only accepts HTML files that are hosted online. You can use the following two methods to fill in the Custom page address field.

Take paperize/500.html as an example, use GitHub raw:

https://raw.githubusercontent.com/katorlys/cloudflare-error-pages/main/paperize/500.html

Use jsDelivr CDN:

https://cdn.jsdelivr.net/gh/katorlys/cloudflare-error-pages/paperize/500.html

Update

Cloudflare will fetch and store the page upon save. However, it will not automatically fetch the page again if it has been modified on your origin. You should manually trigger another fetch to get the latest version.

API

See https://developers.cloudflare.com/api/resources/custom_pages

Development

Limitations

Pay attention to the following limits:

  • Your custom error page should include a page-specific custom error token if applicable and cannot exceed 1.5 MB (1,500,000 bytes). Also, it must include HTML <head> and </head> tags.
  • Make sure that the referrer meta tag is not present in your custom error page's HTML code since it will disrupt Cloudflare challenges: <meta name="referrer" (...) />

Hints

Required tokens

Cloudflare will not accept pages that do not contain the required tokens.

  • 500.html: ::CLOUDFLARE_ERROR_500S_BOX::
  • 1000.html: ::CLOUDFLARE_ERROR_1000S_BOX::
  • interactive.html: ::CAPTCHA_BOX::
  • non-interactive.html: ::IM_UNDER_ATTACK_BOX::
  • ratelimit-block.html: Not required
  • under-attack.html: ::CAPTCHA_BOX::
  • waf-block.html: Not required

Tokens output

Take error 522 as an example, ::CLOUDFLARE_ERROR_5XX_BOX:: and ::CLOUDFLARE_ERROR_1000S_BOX:: will output the following content:

<div class="cf-error-details cf-error-522">
  <h1>Connection timed out</h1>
  <p>The initial connection between Cloudflare's network and the origin web server timed out. As a result, the web page can not be displayed.</p>
  <ul>
    <li>Ray ID: xxxxxxxxxxxxxxxx</li>
    <li>Your IP address: xxx.xxx.xxx.xxx</li>
    <li>Error reference number: 522</li>
    <li>Cloudflare Location: Los Angeles</li>
  </ul>
</div>

Use style="display: none;" to hide the output for users, and use JavaScript to extract the information you need.

For ::CAPTCHA_BOX:: and ::IM_UNDER_ATTACK_BOX::, when previewing the custom error page, it will output the following content:

<div class="main-wrapper" role="main">
  <div class="main-content">
    <h1><img src="/favicon.ico">example.com</h1>
    <h2>Performing security verification</h2>
    <div>This website uses a security service to protect against malicious bots. This page is displayed while the
      website verifies you are not a bot.</div><noscript>
      <div class="h2"><span id="challenge-error-text">Enable JavaScript and cookies to continue</span></div>
    </noscript>
  </div>
</div>
<div class="footer" role="contentinfo">
  <div class="footer-inner">
    <div class="footer-wrapper">
      <div class="clearfix diagnostic-wrapper">
        <div class="ray-id">Ray ID: <code>xxxxxxxxxxxxxxxx</code></div>
      </div>
      <div class="footer-link-wrapper"><span class="footer-text">Performance and Security by <a
            rel="noopener noreferrer" href="https://www.cloudflare.com?utm_source=challenge&amp;utm_campaign=p"
            target="_blank">Cloudflare</a></span><span class="footer-divider"></span><a id="privacy-link"
          target="_blank" rel="noopener noreferrer" href="https://www.cloudflare.com/privacypolicy/"
          class="footer-text">Privacy</a></div>
    </div>
  </div>
</div>

However, when the custom error page is actually displayed to users, it will only output the captcha box.

BACK TO TOP


Copyright © 2026-present Katorly Lab

License

About

A set of well-designed and crafted custom Cloudflare error pages.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages