Creating Custom Error Page with a Worker Site

I have been having some issues with Apache on my server making the site go down twice in 12 hours.

That being the case (while I investigate what is happening serverside) I would like to create a Custom Error Page for 521 errors (I am on teh Pro plan with the site in question).

It says I need to host the page and I wanted to know if it is possible to host it as a Workers site? That way I know even if my server is fully dead (not just Apache) that the Custom Error page will load no matter what.

I ideally I would like to have a super simple error page that says the code (hosted on Workers) and has an iframe to my always online Worker site. (So basically 2 workers per error page deployment)

Is this feasible?

Previously when trying to embed a worker I have had issues of it not loading in the web browser (because of some browsers not allowing cross domain embeds I am assuming and not a problem with Workers itself.)

If the embed is not feasible then I would simply have the custom page link to my Worker Site instead.

In both cases I would need to have the Custom Error Page hosted as a Worker site.



the custom page needs to be hosted only for the time you use to add it, so as long as the server is working when you do the publishing step on Cloudflare it won’t create any issues.

Update custom error page after publishing
After successfully publishing the custom error page in the Custom Pages app, you can remove the page from your origin server.
If in the future, you need to update your custom error page, you must re-publish the page at your origin and in the Cloudflare dashboard, even if the page URL remains unchanged.

Configuring Custom Pages (Error and Challenge) – Cloudflare Help Center

1 Like

Ah right didnt realise that but makes sense now

Great thanks!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.