HTTP 413 Content Too Large (Request Entity Too Large)
The request body is bigger than the server is willing to accept — usually a file upload over the configured limit.
request entity too largepayload too largecontent too largeclient intended to send too large body Meaning
Every layer between the client and your code has its own maximum body size: CDN, load balancer, web server and language runtime. A 413 comes from whichever layer has the smallest limit. Nginx’s default client_max_body_size is only 1 MB.
Common causes
- Nginx
client_max_body_size(default 1m) too small - PHP
upload_max_filesize/post_max_sizelimits - Apache
LimitRequestBody - Framework body-parser limits (Express
json({ limit })default 100kb) - CDN/load balancer limits (Cloudflare Free: 100 MB, API gateways often 10 MB)
⚡ Quick fix
- Raise
client_max_body_sizein Nginx and reload - Raise
upload_max_filesizeandpost_max_sizein php.ini (post ≥ upload) - Raise the framework body-parser limit
- For very large files, upload directly to object storage with pre-signed URLs
Detailed fix by platform
Nginx
- In
http,serverorlocation:nginxclient_max_body_size 50M; - Run
sudo nginx -t && sudo systemctl reload nginx.
PHP
- php.ini (or .user.ini on shared hosting):ini
upload_max_filesize = 50M post_max_size = 55M memory_limit = 256M - Restart PHP-FPM. Note: when PHP’s limit is exceeded,
$_POSTand$_FILESare silently empty rather than a 413.
Node.js
- Express:javascript
app.use(express.json({ limit: '10mb' })); app.use(express.urlencoded({ extended: true, limit: '10mb' }));
Apache
- Set
LimitRequestBody 52428800(bytes) in the vhost or .htaccess.
How to diagnose
- Size — How large is the request body?
- Response origin — Which layer answered — check the Server header and HTML body of the 413
- Limits — CDN → load balancer → web server → runtime → framework
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in HTTP
Other ways to find it
Where this error sits
Origin: Network. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 9 Oct 2026