From eb6cf63b42ef8889db8a4cbdc4e87a673faf9ce8 Mon Sep 17 00:00:00 2001 From: Ryan Malloy Date: Tue, 11 Aug 2026 23:39:40 +0000 Subject: [PATCH] docs-site: serve the branded 404 page with a real 404 status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Missing paths returned 404 with an EMPTY body — the built 404.html was never reached. handle_errors routes 404s to it, status stays honest. --- docs-site/Caddyfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs-site/Caddyfile b/docs-site/Caddyfile index e0f8ffe..a788c22 100644 --- a/docs-site/Caddyfile +++ b/docs-site/Caddyfile @@ -8,4 +8,14 @@ @hashed path /_astro/* header @hashed Cache-Control "public, max-age=31536000, immutable" + + # Serve the branded 404 page with a real 404 status. It was already in + # the build, just never reached — Caddy returned an empty error body. + handle_errors { + @404 expression {err.status_code} == 404 + handle @404 { + rewrite * /404.html + file_server + } + } }