This commit is contained in:
parent
934c94cb5c
commit
1b59b548fa
3 changed files with 16 additions and 12 deletions
|
|
@ -37,7 +37,7 @@ jobs:
|
||||||
nodejs \
|
nodejs \
|
||||||
clang lld libc++ \
|
clang lld libc++ \
|
||||||
wasi-libc wasi-libc++ wasi-libc++abi wasi-compiler-rt \
|
wasi-libc wasi-libc++ wasi-libc++abi wasi-compiler-rt \
|
||||||
git curl tar rsync zstd gzip jq openssl ffmpeg gnupg
|
git curl tar rsync zstd gzip jq openssl ffmpeg gnupg cmake
|
||||||
# Container runs as root; workspace may be owned by another uid.
|
# Container runs as root; workspace may be owned by another uid.
|
||||||
git config --global --add safe.directory '*'
|
git config --global --add safe.directory '*'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,16 +82,20 @@ catcrafts.net {
|
||||||
handle {
|
handle {
|
||||||
reverse_proxy 127.0.0.1:8081 {
|
reverse_proxy 127.0.0.1:8081 {
|
||||||
health_uri /api/healthz
|
health_uri /api/healthz
|
||||||
|
|
||||||
# If the backend is down, fall back to the static wasm shell so the
|
|
||||||
# site degrades to a client-rendered app rather than a Caddy 502.
|
|
||||||
# Content still renders; only real status codes and SSR are lost.
|
|
||||||
@down status 502 503 504
|
|
||||||
handle_response @down {
|
|
||||||
rewrite * /index.html
|
|
||||||
header Cache-Control "no-store"
|
|
||||||
file_server
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# If the backend is down, fall back to the static wasm shell so the site
|
||||||
|
# degrades to a client-rendered app rather than a bare Caddy error page.
|
||||||
|
# This must be handle_errors, not handle_response: handle_response only
|
||||||
|
# fires on responses an upstream actually sent, and a backend that is not
|
||||||
|
# running refuses the connection — that is an error, which only
|
||||||
|
# handle_errors sees (verified against a dead port). The error status is
|
||||||
|
# kept, so a crawler sees the honest 502 while a human gets the working
|
||||||
|
# client-rendered app; only SSR and real 404s are lost.
|
||||||
|
handle_errors 502 503 504 {
|
||||||
|
rewrite * /index.html
|
||||||
|
header Cache-Control "no-store"
|
||||||
|
file_server
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ request arriving mid-copy never hits a truncated executable.
|
||||||
|
|
||||||
## If the backend is down
|
## If the backend is down
|
||||||
|
|
||||||
Caddy's `handle_response @down` falls back to serving the static `index.html`,
|
Caddy's `handle_errors` fallback serves the static `index.html`,
|
||||||
so the site degrades to the client-rendered wasm app rather than showing a 502.
|
so the site degrades to the client-rendered wasm app rather than showing a 502.
|
||||||
Content still renders; what is lost is server-side rendering and real status
|
Content still renders; what is lost is server-side rendering and real status
|
||||||
codes — an unknown path becomes a soft 404 again until the backend returns.
|
codes — an unknown path becomes a soft 404 again until the backend returns.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue