More
More
413 Content Too Large
The request body is bigger than the server allows.
- Code
413- Reason phrase
- Content Too Large
- Class
- 4xx Client error
- Defined in
- RFC 9110 section 15.5.14
- Cacheable by default
- No
What it means
Client error: the problem lies with the request. Repeating it unchanged will normally fail again.
When a server should send it. When the request body is larger than the server will accept. If the limit is temporary, add Retry-After. Proxies send it too: nginx's client_max_body_size defaults to 1 MB.
Common causes. Uploading a file above the limit, often nginx client_max_body_size or PHP upload_max_filesize.
What to do. Upload a smaller file, or raise the limit on the server.
How clients and crawlers treat it
Browsers and HTTP clients. Browsers show the error page the server or proxy returns. An upload stopped by a proxy often looks like a broken connection in JavaScript, because the server closes it before reading the body.
Google Search. Like every 4xx except 429, it tells Google the content does not exist: an indexed URL is removed from the index, and a new one is not processed. Crawl frequency for the URL gradually drops. Source: Google Search Central, How HTTP status codes, and network and DNS errors affect Google Search.
Caching. Not cacheable by default (RFC 9110 section 15.1 does not list it). A cache stores it only when the response says so with Cache-Control or Expires.
Example response
HTTP/1.1 413 Content Too Large Content-Type: text/plain; charset=utf-8 Content Too Large
How to send 413
location /example {
return 413;
}
RewriteEngine On RewriteRule ^example$ - [R=413,L]
http_response_code(413); echo 'Content Too Large'; exit;
res.writeHead(413, { 'Content-Type': 'text/plain' });
res.end('Content Too Large');
# in a view function return 'Content Too Large', 413
Change the paths to suit. In nginx, add_header needs always to apply to error responses.
Related codes
- 414URI Too LongThe address is longer than the server will process.
- 431Request Header Fields Too LargeThe headers are too big, either one header or all of them together.
- 400Bad RequestThe server could not understand the request.
- 507Insufficient StorageThe server has no space left to store what the request needs.
All status codes · All 4xx codes
Names and numbers from the IANA HTTP Status Code Registry. Google Search behaviour as documented by Google Search Central.