diff --git a/src/middleware.ts b/src/middleware.ts index 4528d31..9856100 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -28,7 +28,9 @@ async function getRedirects(siteURL: string) { } export async function middleware(request: NextRequest) { - const siteURL = process.env['NEXT_PUBLIC_SITE_URL'] ?? 'http://localhost:3000' + // Internal self-fetch: must be 127.0.0.1, not localhost — in Docker localhost + // resolves to ::1 while Next listens on IPv4 only, so the fetch fails silently. + const siteURL = process.env['INTERNAL_API_URL'] ?? 'http://127.0.0.1:3000' const pathname = request.nextUrl.pathname const redirects = await getRedirects(siteURL)