Skip to content

Commit 601376b

Browse files
Nathan Flurryclaude
andcommitted
fix(website): static-site Caddy routing (no SPA fallback)
Replace the SPA try_files fallback with static multi-page routing (resolve each page's index.html, serve real 404.html) — this is a Starlight static site, so the old fallback served the landing page for deep links/misses. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent d81e923 commit 601376b

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

frontend/packages/website/Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,18 @@ RUN pnpm build
1717

1818
FROM caddy:alpine
1919
COPY --from=build /app/dist /srv
20+
# Static multi-page site (Astro/Starlight emits <path>/index.html), NOT an SPA —
21+
# resolve each page's index.html and serve the real 404.html on a miss.
2022
RUN cat > /etc/caddy/Caddyfile <<'EOF'
2123
:80 {
2224
root * /srv
25+
encode gzip
26+
try_files {path} {path}/index.html {path}.html
2327
file_server
24-
try_files {path} /index.html
28+
handle_errors {
29+
rewrite * /404.html
30+
file_server
31+
}
2532
}
2633
EOF
2734
EXPOSE 80

0 commit comments

Comments
 (0)