Next.js Discord

Discord Forum

Next.js App Router returning partial/empty response only in Kubernetes behind NGINX Ingress

Unanswered
Selkirk Rex posted this in #help-forum
Open in Discord
Selkirk RexOP
My Next.js (App Router) application intermittently returns 200 OK but with incomplete or empty HTML for server component pages.
It only happens when deployed in Kubernetes, behind NGINX Ingress.

Refreshing a few times changes behavior:

sometimes full content loads

sometimes half the page renders

sometimes RSC parts don’t load at all

🧩 Environment

. Next.js 15.4.8 (App Router)
. Running in a regular Kubernetes cluster
. NGINX Ingress Controller
. Internal services (Python backend) inside same cluster

🔍 Symptoms

Next.js logs show successful responses (no errors).

Browsers occasionally receive truncated RSC / flight responses.

HTML chunks appear to stop mid-stream.

Network calls like _rsc=123xyz show random partial bodies.

The issue does not reproduce locally or in non-K8s environments.

📛 Ingress Logs

Ingress logs look normal (200 for everything):

"GET /workspaces/knowledges/create?_rsc=1s7tm" 200 ...


Upstream container receives full requests and returns 200.

But the HTML that reaches the browser is sometimes cut off.

📦 Relevant Ingress Annotations

Here’s what I currently have:

nginx.ingress.kubernetes.io/enable-http2: "false"
nginx.ingress.kubernetes.io/proxy-http-version: "1.1"
nginx.ingress.kubernetes.io/proxy-buffer-size: 512k
nginx.ingress.kubernetes.io/proxy-buffers: 4 512k
nginx.ingress.kubernetes.io/proxy-busy-buffers-size: 512k
nginx.ingress.kubernetes.io/proxy-read-timeout: "120"
nginx.ingress.kubernetes.io/proxy-send-timeout: "120"

🎯 What I suspect

This feels like a problem in the path between Next.js and NGINX:

NGINX buffering RSC streams in a way Next.js doesn’t expect

Chunked transfer encoding being modified

NGINX closing the connection early

Flight/RSC payload being clipped due to buffer limits

Next.js emitting a streaming chunk that NGINX can’t handle

🛠 Additional Notes
. Backend API returns correct JSON (confirmed in logs).
. Ingress returns consistent 200s.
. Issue appears only when HTML must be streamed.

4 Replies

Pacific sand lance
could be because ur infra setup somehow affects nextjs response stream
Selkirk RexOP
do u think it is fetch issue cuz it is working with undici
Greek Shepherd
Maybe trying to replicate the issue locally using kind could narrow it down?
Selkirk RexOP
After more debugging, it looks like the problem is coming from Bun, not Next.js.
The exact same app works normally when running on Node.js, but fails when running on Bun inside my Kubernetes cluster. Locally and in ECS Bun works fine — the issue appears specifically when Bun handles RSC/Flight responses behind NGINX in K8s.