413 Content Too Large
The request body exceeds a size limit somewhere in the chain. The tricky part is that 'somewhere': the proxy, the app server, and the framework each carry their own limit, and the smallest one wins — often with a bare nginx error page rather than your API's JSON.
What usually causes it
- File uploads exceeding nginx's client_max_body_size (default 1 MB — the classic)
- JSON payloads over framework limits (Express default 100 KB)
- Base64-encoded files inflating payloads by 33% past a limit that raw bytes would fit
How to debug and fix it
- Identify which layer rejected it: the response body/Server header of an nginx 413 differs from your framework's.
- Raise limits consistently across every layer (proxy, server, framework, WAF) — the minimum applies.
- For genuinely large files, switch to direct-to-storage uploads (presigned URLs) instead of proxying bytes through the API.
Easily confused with
Debugging an API? Build and inspect requests, check response headers, or read the full status-code debugging guide.