Skip to content

Commit 3647625

Browse files
author
flowcore-platform
committed
fix: exclude /api/health from middleware for k8s health checks
The readiness probe was failing because /api/health was being processed through NextAuth middleware, causing connection delays/failures. Health checks need immediate response without auth processing. Changes: - Exclude api/health from middleware matcher - Health endpoint now bypasses all NextAuth middleware - Fixes 502 Bad Gateway errors due to failing readiness probes
1 parent 93c6160 commit 3647625

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

middleware.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,7 @@ export default withAuth(
7474
)
7575

7676
export const config = {
77-
matcher: ["/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)"],
77+
matcher: [
78+
"/((?!_next/static|_next/image|favicon.ico|api/health|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)",
79+
],
7880
}

0 commit comments

Comments
 (0)