FULL AI ANALYSIS

NGINX HTTP/2 proxy drops chunked Transfer-Encoding uploads to Next.js API routes — request body never reaches Node

Generated Oct 25, 2026, 9:44:56 AM

Analysis summary

Symptoms indicate NGINX is enforcing buffer/body sizing or mishandling HTTP/2 DATA frames when proxying to a backend over an http1-style upstream. HTTP/2 uses DATA frames that NGINX translates; default client_max_body_size and proxy buffer settings can trigger early 413 responses. proxy_request_buffering off usually helps for large streaming uploads, but combined with HTTP/2 there are known interactions where NGINX expects to buffer the full request. The fact HTTP/1.1 clients succeed suggests the HTTP/2 to upstream translation path and buffering limits are at fault.

Possible causes

NGINX client_max_body_size or proxy buffering limits trigger early 413 for HTTP/2 DATA frames before body forwarded.

85%

proxy_request_buffering behavior with HTTP/2 in current NGINX build has a bug/regression in how chunked frames are handled.

50%

Upstream unix-socket configuration or proxy_pass header translation mishandles Transfer-Encoding when HTTP/2 client requested it.

30%

Client sends malformed chunked frames over HTTP/2 due to browser extension or proxy; unlikely given multiple browsers tested.

10%

Suggested fixes

1

Diagnostic step 1

Set client_max_body_size to the expected max (e.g., 200m) in the server/location block and reload NGINX.

2

Diagnostic step 2

Disable request buffering for the proxied location: 'proxy_request_buffering off;' then reload NGINX.

3

Diagnostic step 3

Ensure proxy_http_version is 1.1 and that 'proxy_set_header Connection "";' is present so NGINX uses chunked transfer to upstream correctly.

4

Diagnostic step 4

Test using curl with --http2 to reproduce and run nginx -T to verify effective config. Verify success by observing request body arrival in Node logs and a 200 response.

5

Diagnostic step 5

If issue persists, enable debug logging for http2 and proxy modules to capture frame-level behavior and consider upgrading NGINX to latest stable or using a small nginx build compiled with latest http2 patches as a temporary test. Roll back config changes if they break other endpoints.