HTTP 413 — Content Too Large
HTTP 413
Content Too Large
The request body is bigger than the server is willing to accept.
What 413 actually means
You tried to upload something larger than a limit somewhere in the chain, and the server cut it off. The limit is usually not in the application at all but in a web server or proxy in front of it — Nginx defaults to a 1 MB body, which is the single most common reason a perfectly good upload endpoint rejects a photo. It was called "Payload Too Large" in RFC 7231 and "Request Entity Too Large" before that; the code and the meaning are the same.
Common causes
- A file upload exceeding the server's configured maximum body size
- Nginx `client_max_body_size` left at its 1 MB default
- PHP `upload_max_filesize` or `post_max_size` too low
- A CDN or load balancer imposing its own body limit before the origin sees the request
- A base64-encoded payload that grew by a third in transit
If you're just trying to view the page
- Upload a smaller file — compress an image, or split a large archive
- Check the site's stated upload limit; many publish one and enforce it here
- If a video or PDF is marginally over, re-export it at lower quality rather than retrying the same file
If it's your site
- Raise `client_max_body_size` in Nginx — it defaults to 1 MB and must be set at `http`, `server` or `location` level
- For PHP, raise both `upload_max_filesize` and `post_max_size`, and remember `post_max_size` must be the larger of the two
- Check every hop: CDN, load balancer, reverse proxy and application each have their own limit and the smallest one wins
- Send `Retry-After` if the limit is temporary, and state the actual maximum in the error body
- For genuinely large files, use direct-to-storage uploads with presigned URLs rather than proxying through the app
Reference
- Status code
- 413
- Reason phrase
- Content Too Large
- Category
- 4xx — Client Error
- Defined in
- RFC 9110 §15.5.14
Common questions
- What does HTTP 413 mean?
- The request body is bigger than the server is willing to accept. You tried to upload something larger than a limit somewhere in the chain, and the server cut it off. The limit is usually not in the application at all but in a web server or proxy in front of it — Nginx defaults to a 1 MB body, which is the single most common reason a perfectly good upload endpoint rejects a photo.
- How do I fix a 413 error?
- Upload a smaller file — compress an image, or split a large archive
- Is 413 a client error or a server error?
- 413 is in the 4xx range, which means client error. The request itself was the problem, so retrying it unchanged will usually return the same code.
Related pages
- 404 Not Found The server is reachable and working, but there is nothing at the address you ask
- 403 Forbidden The server understood the request and is refusing to allow it, and logging in wi
- 401 Unauthorized You need to authenticate, and either you did not or your credentials were reject
- 429 Too Many Requests You have sent more requests than the service allows in a given period.
- 400 Bad Request The server could not understand the request because something about it is malfor
- 422 Unprocessable Content The request is well-formed and understood, but the data in it fails the rules.
- 405 Method Not Allowed The URL exists, but it does not accept the HTTP method you used.
- 409 Conflict The request cannot be completed because it clashes with the current state of the
- 415 Unsupported Media Type The server will not accept the format of the body you sent.
- 408 Request Timeout The server gave up waiting for the client to finish sending its request.
- 410 Gone The resource was deliberately removed and is not coming back, and there is no fo
- 451 Unavailable For Legal Reasons The content is blocked because of a legal demand — a court order, takedown notic