nginx
- Setting
client_max_body_size- Default or documented value
1m;0disables the check- Fix
- Raise it in
http,serverorlocation, then reload
A 413 means the request body is bigger than the server allows. Learn how visitors shrink uploads and how admins raise limits on nginx, Apache, PHP and Cloudflare.
A 413 (Request Entity Too Large, now named Content Too Large) means the server refuses the request because its body is larger than the server is willing or able to process. Visitors should send a smaller file. Site owners must raise the limit in each layer that sets one: nginx client_max_body_size, Apache LimitRequestBody, PHP upload settings and any CDN.
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
RFC 9110 says the 413 status code indicates that the server is refusing to process a request because the request content is larger than the server is willing or able to process. The server may terminate the request if the protocol version allows it, and otherwise may close the connection. If the condition is temporary, the server should send a Retry-After header saying when the client may try again.
The name changed over time. MDN notes that before RFC 9110 the phrase was "Payload Too Large" and that this message is still widely used. The nginx docs still call it 413 (Request Entity Too Large). It is the same status code.
It differs from a 400, where the request is malformed. Here the request is valid but too big. The nginx docs add a warning that browsers cannot correctly display this error.
client_max_body_size1m; 0 disables the checkhttp, server or location, then reloadLimitRequestBody1073741824 bytes (older than 2.4.54: 0, unlimited).htaccess scopepost_max_size, upload_max_filesize8M post data; 2M upload (per the PHP manual)post_max_size must be larger than upload_max_filesizePHP behaves differently from the web servers. Its manual says that if the post data is greater than post_max_size, the $_POST and $_FILES superglobals are empty. So a PHP limit gives a form that silently loses its upload, not necessarily a 413.
client_max_body_size. The default is 1 MB.The directive works in http, server and location. Put it in the narrowest scope that needs it.
Run nginx -t, then nginx -s reload.
A load balancer, CDN or another nginx can still enforce a smaller limit. Test the origin directly to see which layer answers.
Raise PHP or framework limits to match, or the upload fails further along.
server {
location /upload {
client_max_body_size 50m;
}
}Causes and fixes differ by server and platform. See the 413 guides for nginx.
Apache's docs say that if the request exceeds the limit, the server returns an error response instead of servicing the request. They also say a PUT implementation needs a value at least as large as any representation the server wants to accept.
post_max_size = 64M
upload_max_filesize = 50MOn Cloudflare, customers can adjust the Maximum Upload Size from the zone's Network page, and Cloudflare says setting it below the size of an incoming request causes a 413. Its 413 page ties the per-plan figures to the Cloudflare API upload limit, so treat the table row as Cloudflare's published numbers and check your plan. If you need a larger upload, Cloudflare's guidance is to break the request into smaller chunks, change the DNS record to DNS-only, or upgrade the plan.
<Location "/upload">
LimitRequestBody 104857600
</Location>A 413 happens on uploads and API posts, not on page views, so crawlers rarely meet it. If Search Console reports one on a page URL, check which rule produces it, since a normal GET request should not carry a large body. Google handles 4xx codes except 429 as content that doesn't exist, and removes indexed URLs that return them. See 4xx errors.
4 questions people ask next, answered from the sources on this page.
The server refuses to process the request because its body is larger than the server is willing or able to handle. The current standard name is Content Too Large; Payload Too Large and Request Entity Too Large are older names.
Send a smaller file, or raise the limit in each layer that sets one: nginx client_max_body_size, Apache LimitRequestBody, PHP upload settings and any CDN. Reload the service and test again.
A second layer still has a smaller limit. A CDN, proxy or load balancer in front of the server, or a PHP or framework setting behind it, can enforce its own cap, and the smallest one wins.
Same fix, different name. Payload Too Large is the older MDN wording for the 413 status. Find the layer that enforces the size limit and raise it, or split the upload into smaller chunks.
Run the free audit, then approve the fixes. Every change can be undone.