docs-site: serve the branded 404 page with a real 404 status
Some checks failed
CI / Lint and Format (push) Has been cancelled
CI / Test Python 3.11 on macos-latest (push) Has been cancelled
CI / Test Python 3.12 on macos-latest (push) Has been cancelled
CI / Test Python 3.13 on macos-latest (push) Has been cancelled
CI / Test Python 3.10 on ubuntu-latest (push) Has been cancelled
CI / Test Python 3.11 on ubuntu-latest (push) Has been cancelled
CI / Test Python 3.12 on ubuntu-latest (push) Has been cancelled
CI / Test Python 3.13 on ubuntu-latest (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Build Package (push) Has been cancelled
Some checks failed
CI / Lint and Format (push) Has been cancelled
CI / Test Python 3.11 on macos-latest (push) Has been cancelled
CI / Test Python 3.12 on macos-latest (push) Has been cancelled
CI / Test Python 3.13 on macos-latest (push) Has been cancelled
CI / Test Python 3.10 on ubuntu-latest (push) Has been cancelled
CI / Test Python 3.11 on ubuntu-latest (push) Has been cancelled
CI / Test Python 3.12 on ubuntu-latest (push) Has been cancelled
CI / Test Python 3.13 on ubuntu-latest (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Build Package (push) Has been cancelled
Missing paths returned 404 with an EMPTY body — the built 404.html was never reached. handle_errors routes 404s to it, status stays honest.
This commit is contained in:
parent
1cb6ad1a59
commit
eb6cf63b42
@ -8,4 +8,14 @@
|
|||||||
|
|
||||||
@hashed path /_astro/*
|
@hashed path /_astro/*
|
||||||
header @hashed Cache-Control "public, max-age=31536000, immutable"
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user