File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,6 +104,21 @@ COPY --from=builder --chown=nextjs:nodejs /app/apps/web/.next/standalone ./
104104# Copy static files
105105COPY --from=builder --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static
106106
107+ # Force `experimental.trustHostHeader: true` in the standalone server.
108+ # Next.js hard-codes this to `false` at build time unless running on Vercel
109+ # (`build/index.js`: `trustHostHeader: _ciinfo.hasNextSupport`). Behind our
110+ # nginx reverse proxy the host header is the public domain, which differs
111+ # from the standalone server's bound address — so when next-intl emits an
112+ # absolute `x-middleware-rewrite` value, Next's `relativizeURL` sees a host
113+ # mismatch and falls through to `proxyRequest`. That proxy then tries to
114+ # loop back through DNS and fails with `ECONNREFUSED 127.0.0.2:443` on
115+ # every locale-rewritten route (`/dashboard` → `/en/dashboard`, causing a
116+ # 500 right after login). Patching the embedded config blob flips the flag
117+ # so the standalone server builds its `initUrl` from the same host header
118+ # next-intl uses, the rewrite stays internal, and the proxy path is never
119+ # entered. Idempotent: sed is a no-op if the substring is absent.
120+ RUN sed -i 's/"trustHostHeader":false/"trustHostHeader":true/g' ./apps/web/server.js
121+
107122# Copy database package with migrations and seed
108123COPY --from=builder /app/packages/db/src ./packages/db/src
109124COPY --from=builder /app/packages/db/scripts ./packages/db/scripts
Original file line number Diff line number Diff line change @@ -61,4 +61,3 @@ const nextConfig: NextConfig = {
6161} ;
6262
6363export default withNextIntl ( nextConfig ) ;
64-
Original file line number Diff line number Diff line change 1111-- The DROP IF EXISTS line removes any prior IVFFlat index (the legacy naming
1212-- drizzle-kit would have used for the same column) so this migration is safe
1313-- whether or not a previous ANN index exists.
14- BEGIN ;
15-
14+ --
15+ -- No explicit BEGIN/COMMIT here: drizzle-kit's migrator already wraps each
16+ -- migration in a transaction. Nesting one manually produced the
17+ -- "there is already a transaction in progress" / "there is no transaction
18+ -- in progress" warnings logged by Postgres on every startup.
1619DROP INDEX IF EXISTS " content_embeddings_embedding_ivfflat_idx" ;
1720DROP INDEX IF EXISTS " content_embeddings_embedding_idx" ;
1821
1922CREATE INDEX IF NOT EXISTS " content_embeddings_embedding_hnsw_idx"
2023 ON " content_embeddings"
2124 USING hnsw (" embedding" vector_cosine_ops)
2225 WITH (m = 16 , ef_construction = 64 );
23-
24- COMMIT ;
You can’t perform that action at this time.
0 commit comments