Skip to content

Commit 8c220bf

Browse files
theo-learnerclaude
andcommitted
fix: scope well-known rewrite to oauth-* paths only to avoid breaking ACME
The previous /.well-known/* handler intercepted ALL well-known paths including /.well-known/acme-challenge/ used by Caddy's Let's Encrypt HTTP-01 challenge. This caused TLS certificate provisioning to fail. Narrow the rewrite to /.well-known/oauth-* which covers the two OAuth discovery endpoints (oauth-protected-resource, oauth-authorization-server) without touching the ACME challenge path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 38ede25 commit 8c220bf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Caddyfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
# Rewrite OAuth well-known endpoints from domain root to basePath.
1111
# RFC 8414 / RFC 9728 require these at the domain root, but Next.js
1212
# serves them under NEXT_PUBLIC_BASE_PATH (e.g. /thanos-sepolia/).
13-
# Caddy rewrites the path before forwarding to Next.js.
14-
handle /.well-known/* {
13+
# IMPORTANT: only match oauth-* paths to avoid intercepting
14+
# /.well-known/acme-challenge/ used by Caddy's TLS provisioning.
15+
handle /.well-known/oauth-* {
1516
rewrite * {$NEXT_PUBLIC_BASE_PATH:}{uri}
1617
reverse_proxy sentinai:8080
1718
}

0 commit comments

Comments
 (0)