Free auditStart free
GuideError · HTTP status codes

413 Request Entity Too Large in Apache

Fix an Apache 413: check LimitRequestBody (default changed in 2.4.54), the log line to look for, per-directory overrides and the PHP limits that sit behind it.

3 min
read
8
sources
Oct 31, 2026
updated
Scaplet Editorial Team
author
The short answer

Apache returns 413 when a request body is larger than LimitRequestBody. Since httpd 2.4.54 the default is 1073741824 bytes (1 GiB); in 2.4.53 and earlier it was 0, meaning unlimited. So a 413 means someone set the limit, often in a vhost, directory or .htaccess. Find where it is set, raise it, reload and retry.

  1. What Apache is telling you
  2. Find the 413 in the logs
  3. Set the limit where it applies
  4. Other limits behind an Apache 413
  5. Checklist before you reload
30-second check

Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?
Summarize this page withChatGPTClaudePerplexityGoogleAI Mode
02Check it

Find the 413 in the logs

Apache logs the cause at LogLevel info. In the httpd source, a request whose Content-Length exceeds the limit logs Requested content-length of N is larger than the configured limit of M (message AH10483, and AH01588 from the input filter). The default error page says the resource "does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit".
Reproduce with a known size
head -c 2000000 /dev/zero > /tmp/big.bin
curl -i -X POST --data-binary @/tmp/big.bin https://example.com/upload
Raise the log level briefly to see the message
# httpd.conf or the vhost
LogLevel info

# then reload and retry the upload
# apachectl configtest && apachectl graceful
03Fix it on your stack

Set the limit where it applies

Per-location limit of 100 MiB in a vhost
<Location "/upload">
    LimitRequestBody 104857600
</Location>
Directory or .htaccess (needs AllowOverride All)
# .htaccess in /var/www/html/uploads
LimitRequestBody 104857600
The docs' 100K example, for reference
LimitRequestBody 102400

The directive is valid in several contexts, so the value that fires may not be the one in httpd.conf. Search all of them: grep -rn LimitRequestBody /etc/apache2 /etc/httpd /var/www.

04Where else a big upload can fail

Other limits behind an Apache 413

Layer

PHP

Setting
upload_max_filesize
Documented default
2M
Layer

PHP

Setting
post_max_size
Documented default
8M
Layer

Apache proxy to another server

Setting
Limits on that server
Documented default
Check its docs
Layer

Slow uploads

Setting
RequestReadTimeout body=...
Documented default
body=20,MinRate=500; a 408 is sent if a stage is not completed

PHP limits are separate from Apache's: raising LimitRequestBody does not raise upload_max_filesize. See 413 in PHP. Also remember that a request body on a method that does not allow one is rejected: Apache's source logs %s with body is not allowed for %s and returns 413.

05Checklist

Checklist before you reload

  1. 01Run apachectl configtest (or httpd -t) so a typo does not take the site down.
  2. 02Search every context: server config, each vhost, <Directory>, <Location> and .htaccess.
  3. 03If the upload goes through a reverse proxy, find the limit on the next server; Apache's own limit only covers requests it receives.
  4. 04Test with a file just over the old limit and just under the new one, not a huge file, so you know which side of the line you are on.
  5. 05Set the limit per path when only one endpoint needs big bodies, as in the <Location> example, instead of raising it server-wide.

A smaller limit on public forms is a sensible default. The docs say the directive gives the administrator "greater control over abnormal client request behavior, which may be useful for avoiding some forms of denial-of-service attacks", so raise it only as far as the endpoint needs.

06Explained

SEO and crawler notes

Crawlers rarely send large bodies, so a 413 on uploads seldom touches indexing. Google treats it as a 4xx like any other: URLs returning one are not indexed. See 413 Request Entity Too Large.
Questions

Asked a lot.

3 questions people ask next, answered from the sources on this page.

01What is the default LimitRequestBody in Apache?

1073741824 bytes from httpd 2.4.54. In 2.4.53 and earlier the default was 0, which means unlimited.

02Where do I set LimitRequestBody?

In server config, a virtual host, a directory or .htaccess. For .htaccess the directory needs AllowOverride All, which is the override the docs list.

03I raised LimitRequestBody and uploads still fail. Why?

PHP has its own upload_max_filesize (2M documented default) and post_max_size (8M). Raise those too, and check any proxy or CDN in front.

Sources · 8

Every fact, linked and dated.

Official docs first. The date is when we last opened each page.
  • rfc-editor.org
  • apache.org
  • githubusercontent.com
  • php.net
  • google.com
  1. 01RFC 9110: HTTP Semanticsrfc-editor.org · checked 2026-11-01
  2. 02Apache core: LimitRequestBodyhttpd.apache.org · checked 2026-11-01
  3. 03Apache mod_reqtimeouthttpd.apache.org · checked 2026-11-01
  4. 04httpd source: modules/http/http_filters.craw.githubusercontent.com · checked 2026-11-01
  5. 05httpd source: modules/http/http_protocol.craw.githubusercontent.com · checked 2026-11-01
  6. 06PHP: description of core php.ini directivesphp.net · checked 2026-11-01
  7. 07PHP: php.ini directivesphp.net · checked 2026-11-01
  8. 08How HTTP status codes affect Google's crawlersdevelopers.google.com · checked 2026-11-01
Free · 2 minutes

Tools point. Agencies advise. This one ships.

Run the free audit, then approve the fixes. Every change can be undone.

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • 0→7 ChatGPT citations in six weeks Paylane