HTTP 413 · 4XX RFC 9110 §15.5.14 Cacheable: No Retryable: No (reduce payload or use chunked/presigned upload)

HTTP 413 Content Too Large: Root Causes & Production Fix Guide

HTTP 413 Content Too Large (formerly Payload Too Large) occurs when an upload or JSON body exceeds the configured limit in Nginx (default 1MB!), Express/Fastify, AWS API Gateway, or Cloudflare (100MB Free/Pro).

Top Root Causes of HTTP 413

Nginx & Express Body Size Limit Fix for 413

# Nginx (http, server, or location block)
client_max_body_size 50M;

# Express.js (align with Nginx)
app.use(express.json({ limit: '50mb' }));
app.use(express.urlencoded({ limit: '50mb', extended: true }));

Verify with cURL

curl -i -sS -F 'file=@large-file.zip' https://api.example.com/v1/upload

Interactive Stack Diagnoser (HTTP 413)

Frequently Asked Questions

Why do I still get 413 after raising Nginx client_max_body_size?

Check every layer in the chain: Cloudflare (100MB Free/Pro), Kubernetes Ingress annotation `proxy-body-size`, and your app framework (`express.json`, Django `DATA_UPLOAD_MAX_MEMORY_SIZE`, PHP `upload_max_filesize`).

How should I upload files larger than 100MB behind Cloudflare?

Use direct-to-S3/R2 presigned URLs or tus/chunked multipart uploads so large binaries bypass Cloudflare's 100MB single-request cap.

Did RFC 9110 rename 413?

Yes. RFC 9110 renamed 'Payload Too Large' (RFC 7231) to 'Content Too Large'; the status code 413 is identical.

Related Status Guides & Header Tools