networking
http
ai_generated
true
HTTP/1.1 413 Payload Too Large
ID: networking/http-413-payload-too-large
92%Fix Rate
93%Confidence
60Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| any | active | — | — | — |
Root Cause
The server rejected the request because the request body exceeds the configured maximum size. This is commonly triggered by file uploads, large JSON payloads, or POST data exceeding server limits set in nginx, Apache, or the application framework.
genericWorkarounds
-
95% success Increase the server's maximum request body size limit
1. In nginx: client_max_body_size 100M; (in http, server, or location block) 2. In Apache: LimitRequestBody 104857600 3. In Node.js Express: app.use(express.json({ limit: '100mb' })) 4. In PHP: upload_max_filesize = 100M and post_max_size = 100M in php.ini 5. If behind a load balancer, also increase the limit there (e.g., AWS ALB has a fixed 1GB limit) 6. Reload the server: systemctl reload nginx -
88% success Implement multipart upload or chunked file upload on the client side
1. Split large files into smaller parts on the client 2. Upload each part as a separate HTTP request 3. Use a server-side API that supports multipart assembly (e.g., S3 multipart upload) 4. Reassemble parts on the server after all chunks are uploaded 5. This avoids hitting per-request size limits entirely
Dead Ends
Common approaches that don't work:
-
Retry the same request expecting a different result
99% fail
The 413 response is deterministic based on the request body size. Retrying with the same payload will always produce the same error. The body size or the server limit must change.
-
Split the request body into chunks sent in the same single request
85% fail
HTTP request body size limits apply to the total content-length, not individual chunks. Chunked transfer encoding does not bypass body size limits — the server still counts the total bytes received.
Error Chain
Leads to:
Preceded by:
Frequently confused with: