HTTP 413 Payload Too Large — Request Entity Size Limit
Warning4xx client error
Overview
HTTP 413 Payload Too Large means the request body exceeds the server's configured maximum size limit for uploads or POST data.
Key Details
- Server rejected the request because the body exceeds its size limit
- Common with file uploads, large form submissions, and API payloads
- Nginx default is 1MB (client_max_body_size), Apache default is ~2GB
- Cloudflare free plan limits uploads to 100MB
- The server may close the connection before the full body is received
Common Causes
- Uploading files larger than the server or proxy allows
- Nginx client_max_body_size set too low for your use case
- CDN or WAF enforcing upload size limits
- PHP post_max_size or upload_max_filesize too small
Steps
- 1For Nginx: increase client_max_body_size in nginx.conf (e.g., client_max_body_size 50M;)
- 2For Apache: increase LimitRequestBody in httpd.conf or .htaccess
- 3For PHP: increase both upload_max_filesize and post_max_size in php.ini
- 4For Node.js/Express: set bodyParser limit (app.use(express.json({ limit: '50mb' })))
- 5If using a CDN, check their upload limits (Cloudflare: 100MB free, 500MB pro)
Tags
http413payload-too-largeupload-limitfile-upload
More in 4xx Client Error
http-400-bad-requestHTTP 400 Bad Request — What It Means & How to Fix It
Errorhttp-401-unauthorizedHTTP 401 Unauthorized — What It Means & How to Fix It
Errorhttp-402-payment-requiredHTTP 402 Payment Required — What It Means & How to Fix It
Errorhttp-403-forbiddenHTTP 403 Forbidden — What It Means & How to Fix It
Errorhttp-404-not-foundHTTP 404 Not Found — What It Means & How to Fix It
Errorhttp-405-method-not-allowedHTTP 405 Method Not Allowed — What It Means & How to Fix It
ErrorFrequently Asked Questions
It varies: Nginx is 1MB, Apache is ~2GB, PHP is 2MB, Express.js is 100KB. Check your specific stack.