Error Codes Wiki

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

  1. 1For Nginx: increase client_max_body_size in nginx.conf (e.g., client_max_body_size 50M;)
  2. 2For Apache: increase LimitRequestBody in httpd.conf or .htaccess
  3. 3For PHP: increase both upload_max_filesize and post_max_size in php.ini
  4. 4For Node.js/Express: set bodyParser limit (app.use(express.json({ limit: '50mb' })))
  5. 5If using a CDN, check their upload limits (Cloudflare: 100MB free, 500MB pro)

Tags

http413payload-too-largeupload-limitfile-upload

More in 4xx Client Error

Frequently Asked Questions

It varies: Nginx is 1MB, Apache is ~2GB, PHP is 2MB, Express.js is 100KB. Check your specific stack.