Error 1033, a self-hosted blog, and a small Worker from the edge that covers the gap.
A few days ago the origin behind this blog lost its connection for a while. Normally that's just annoying — but this blog is served through a Cloudflare Tunnel: no connection, no tunnel, no blog. And every visitor got the same thing:
Error 1033 — Cloudflare Tunnel error
A stock Cloudflare page with no context, no branding, and no explanation. This post covers why that happens, why I couldn't just restyle the page with Cloudflare's own tooling on the Free plan, and the small Cloudflare Worker I deployed to replace it with a proper "temporarily offline" page.
The setup: one origin, one tunnel
I don't expose the origin to the internet. Instead, cloudflared runs on the origin host and opens outbound connections to Cloudflare's edge, while a proxied CNAME points the blog hostname at the tunnel:
blog.lucad.cloud -> CNAME -> <tunnel-id>.cfargotunnel.com (proxied)
No open ports, no reverse proxy in the DMZ, TLS handled by Cloudflare. It's a great setup — with one built-in caveat: your blog's uptime is exactly as good as that single outbound connection. When it dropped, cloudflared had nothing to stay connected through, the tunnel went Down, and Cloudflare had no healthy connector to route traffic to.
Why visitors see Error 1033
For a tunnel-served hostname, Cloudflare's edge doesn't know anything about the machine behind the blog — it only knows there should be a cloudflared connector on the other end. No healthy connector means nothing to forward the request to, and the edge responds with Error 1033 (Cloudflare Tunnel error).
It's the tunnel equivalent of a dead origin. And here's the catch: on the Free plan, that page is not customizable.
The catch: custom error pages are paid-only
Cloudflare does let you replace its error pages — Custom Errors → Error Pages, where the "1000 class" page covers the whole 1xxx family (1033 included). But:
- It's a paid feature (Pro and up). On Free, the option doesn't exist.
- Even on paid plans, you must host the replacement HTML at a public URL and include Cloudflare's token
::CLOUDFLARE_ERROR_1000S_BOX::; Cloudflare fetches it and stores it (updating means re-fetching). - The lightweight alternative, Snippets, is paid-only too.
So the official lever isn't available. Time for a different angle.
The idea: a Worker that proxies, with a fallback
Cloudflare Workers run at the edge, before your origin is contacted. That's the property this whole trick relies on:
- Attach a Worker to the blog's hostname (
blog.lucad.cloud/*). - The Worker tries to fetch the origin — i.e., the tunnel.
- Tunnel up? Return the origin's response. The Worker is invisible.
- Tunnel down? The fetch fails, the Worker catches it and returns a custom offline page instead of Cloudflare's Error 1033.
Crucially, a down tunnel doesn't stop the Worker: it lives at the edge, exactly where the traffic arrives. And Workers have a generous free tier — 100,000 requests/day is miles more than a personal blog needs.
The script
// Fallback page worker — serves a custom offline page when this site's
// origin (Cloudflare Tunnel) is down, and proxies normally when it is up.
//
// Route to attach: blog.lucad.cloud/* (zone: lucad.cloud)
const OFFLINE_PAGE = `<!doctype html>
<html lang="en">
Boring HTML & CSS blablabla...
</html>`;
export default {
async fetch(request) {
let response;
try {
response = await fetch(request);
} catch (err) {
// Origin (tunnel) unreachable — the runtime throws.
return offline();
}
// Edge-generated 1xxx error pages (e.g. 1033) may also come back as a
// 52x/530 response instead of a thrown error — swap those too.
if (response.status >= 520 && response.status <= 530) {
return offline();
}
return response;
},
};
function offline() {
return new Response(OFFLINE_PAGE, {
status: 503,
headers: {
"content-type": "text/html; charset=utf-8",
"cache-control": "no-store",
"retry-after": "300",
},
});
}
A few details worth calling out:
fetch(request)throws when the origin is unreachable — hence thetry/catch. I also swap out responses in the52x/530range, in case the edge error surfaces as a response instead of an exception.- The fallback returns 503 +
Retry-After: 300: the correct semantics for "temporarily unavailable". Crawlers treat it as temporary instead of learning something wrong about your site. Cache-Control: no-storeso the fallback is never cached;<meta name="robots" content="noindex">keeps it out of search results.- The page auto-refreshes every 60 seconds, so visitors get your site back as soon as the connection does.
- Everything — logic and HTML — lives in one script: one thing to deploy.
Deploying it (about five minutes)
From the dashboard:
- Workers & Pages → Create → Create Worker; name it (e.g.
blog-offline-fallback) and deploy. - Edit code → paste the script above → Deploy.
- Worker → Settings → Domains & Routes → Add → Route: zone
your-domain.com, routeblog.your-domain.com/*. Use a Route, not a "Custom domain" — the hostname has to stay attached to the tunnel. - Done.
Or from the terminal with Wrangler. A minimal wrangler.toml:
name = "blog-offline-fallback"
main = "worker.js"
compatibility_date = "2026-10-08"
routes = [
{ pattern = "blog.lucad.cloud/*", zone_name = "lucad.cloud" }
]
then:
npx wrangler login
npx wrangler deploy
Verified while the connection was actually down
I deployed this while the connection was still out. With the tunnel genuinely down:
$ curl -I https://blog.lucad.cloud/
HTTP/1.1 503 Service Unavailable
content-type: text/html; charset=utf-8
cache-control: no-store
retry-after: 300
...and the body was my offline page. When the connection came back, the Worker became invisible again: normal 200 responses, the blog exactly as before, no intervention needed. The fallback is only a fallback.
Takeaways
- If your origin sits behind a Cloudflare Tunnel, Error 1033 is what downtime looks like to your visitors.
- On the Free plan, Cloudflare's error pages can't be restyled — but you don't need them: a tiny edge Worker owns the response before the origin is ever contacted.
- Give temporary outages the right status code (503 + Retry-After) and search engines will treat them for what they are.
- The whole solution is free-tier, single-file, and self-healing.
If you serve your site through a tunnel, this is one of those ten-minute fixes that turns a hard, ugly failure into a small, graceful "be right back".
