From bf330d7310f12bddce1fdf1af8d61a758dd102fe Mon Sep 17 00:00:00 2001 From: Ryan Malloy Date: Fri, 13 Feb 2026 15:15:35 -0700 Subject: [PATCH] Fix /health endpoint: wrap file_server in handle block try_files is a rewriter that runs before handlers in Caddy's directive order, rewriting /health to /index.html before handle /health matches. Wrapping try_files + file_server in a catch-all handle block makes it mutually exclusive with handle /health. --- Caddyfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Caddyfile b/Caddyfile index 49b66df..abd5ee4 100644 --- a/Caddyfile +++ b/Caddyfile @@ -6,6 +6,8 @@ respond "ok" 200 } - try_files {path} {path}/index.html {path}/ /index.html - file_server + handle { + try_files {path} {path}/index.html {path}/ /index.html + file_server + } }