HTTP 413 means a server or intermediary refused a request because its content exceeded an accepted size limit. To fix HTTP 413, identify which layer rejected the upload, then reduce the request or adjust that layer’s permitted size. Check CDN, reverse-proxy and application limits separately; increasing one does not change the others. RFC 9110 defines the status.
Start with response evidence and correlated logs. Changing a setting before locating the rejection can leave the original failure untouched.
Key Facts
- HTTP 413 indicates that request content exceeds what the receiving server will process.
- A 413 response alone does not identify the rejecting layer.
- Compare the complete serialized request body with the body limit; HTTP request-header limits are separate.
- Changing one upload limit does not change limits elsewhere in the request path.
- Treat a numeric 413 as failure even when accompanying text says OK.
- Confirm that intended uploads succeed and oversized requests remain rejected.
What HTTP 413 means
Content Too Large is the current name; Payload Too Large and the older Request Entity Too Large describe the same status. See HTTP status codes for scrapers for broader context.
Capture the actual response
Set UPLOAD_URL to an authorized endpoint and prepare payload.bin with the intended content. Preserve the original method, authentication and content type when reproducing a failure.
curl -i --data-binary @payload.bin "$UPLOAD_URL"
This sends a POST and defaults to Content-Type: application/x-www-form-urlencoded. Set the content type required by the endpoint; use application/octet-stream only for endpoints accepting raw binary. It does not construct a multipart upload. See the curl manual and curl header guide.
Tested November 18, 2026 with curl 8.5.0: a 2048-byte payload.bin sent to https://httpbin.org/post returned HTTP/2 200 and echoed Content-Length: 2048.
Retain the status, headers and body, removing secrets before sharing. The command above does not make HTTP 413 alone produce exit code 22. To return failure while preserving the response body, add --fail-with-body, available since curl 7.76.0. Unlike --fail, it retains the error body; -i includes response headers. Exit 22 represents HTTP errors generally, not specifically 413. Failure options.
Which layer returned HTTP 413?
Find the earliest component whose logs explain the rejection. A response header alone does not identify it.
Measure the complete serialized body: files, fields, multipart boundaries and part headers, plus any base64 expansion and JSON wrapping. Compare that byte count with the body limit. HTTP request-header limits are separate.
Match timestamps, route, method and request identifiers across logs. Missing application logs suggest earlier rejection only after confirming that logging works. Map the path with the reverse-proxy guide. Rotating IPs cannot raise an upload limit.
| Symptom | Check | Next action |
|---|---|---|
| Small succeeds, large fails | Same route and authentication; serialized byte counts | Reduce payload or adjust the confirmed threshold. |
| Application sees no request | CDN and proxy logs | Locate an earlier rejection. |
| Limit changed, failure persists | Configuration scope, reload and upstream logs | Correct the scope or locate another limit. |
| Parser reports oversize | Parser error and allowance | Adjust the parser handling that route. |

Treat 413 accompanied by OK as failure. The numeric status takes priority over the HTTP/1.1 reason phrase. RFC 9112.
What can you do in your role?
| Role | Next action |
|---|---|
| Visitor | Reduce the upload or contact the owner with its size, time and error. |
| Developer | Inspect serialization and the parser handling the route. |
| Server owner | Check configuration scope and the running instance. |
| Scraper or API client | Reduce batches; split uploads only where supported. |
Preserve the request shape when translating a reproduction into application code. The curl-to-Python guide can help.
How to fix HTTP 413 on your platform
Change the confirmed constraint. The following allowances are illustrative, not universal recommendations.
nginx
If nginx logs confirm the rejection, edit client_max_body_size in the matching existing location or server block. This example permits a body up to 25 MiB:
client_max_body_size 25m;
Check inherited settings and more specific overrides. Keep body-size checking enabled. nginx body-limit reference.
Use nginx -T with the deployed instance’s configuration and prefix to inspect and validate configuration files. After editing, run nginx -t with those same settings. Reload the correct instance with nginx -s reload only after validation succeeds, then check reload logs and repeat the upload. A configuration dump does not prove that running workers loaded the change. nginx command reference.
Cloudflare
Check the plan allowance and the zone’s Maximum Upload Size setting. A lower zone setting can reject an otherwise permitted upload; increasing an origin limit cannot raise an edge ceiling. Reduce requests through a supported upload flow or review the allowance. Cloudflare 413 documentation.
IIS and ASP.NET Core
Inspect the status, substatus and rejecting module. Microsoft’s request-limits reference lists 413.1 for excessive content length; its troubleshooting documentation also describes 404.13. Diagnose the recorded response.
If request filtering rejected the upload, adjust maxAllowedContentLength, in bytes, in the applicable web.config request-filtering configuration. For in-process hosting, also check IISServerOptions.MaxRequestBodySize. For Kestrel-enforced rejection, check KestrelServerOptions.Limits.MaxRequestBodySize. Multipart parsing has a separate MultipartBodyLengthLimit. Raising an application allowance cannot override a lower IIS filtering limit. Change the confirmed constraint and repeat the original request. ASP.NET Core upload limits.
Investigate uploadReadAheadSize only when the rejecting module and logs implicate read-ahead buffering. IIS runtime settings.
Apache, PHP and WordPress
If Apache enforces the rejection, change LimitRequestBody in the applicable scope. This sets a 25 MiB total-body allowance. Apache reference.
LimitRequestBody 26214400
If PHP upload settings are the constraint, an illustrative single-file allowance is:
upload_max_filesize = 20M
post_max_size = 25M
The total POST allowance must accommodate all files, fields and multipart overhead. Exceeding post_max_size leaves $_POST and $_FILES empty; that alone does not identify which component generated HTTP 413. PHP upload directives.
Edit the configuration used by web requests, apply the runtime’s reload or restart procedure, and retest through the original hostname. For WordPress, check these same web-server and PHP settings. PHP configuration loading.
Express and Spring Boot
For an Express route using body-parser’s JSON parser, replace the relevant existing configuration with a bounded allowance such as bodyParser.json({ limit: '2mb' }). Adding another parser after an earlier parser rejects the body cannot fix the request. Body-parser does not handle multipart uploads; configure that middleware separately. body-parser documentation.
For Spring Boot servlet multipart uploads, illustrative application.properties settings are:
spring.servlet.multipart.max-file-size=20MB
spring.servlet.multipart.max-request-size=25MB
The first limits an individual file; the second limits the multipart request. These do not establish a general JSON-body allowance. Confirm the deployed version, apply the configuration and retest. Spring Boot properties.
For express-http-proxy, inspect its own limit option when body parsing rejects the request. Confirm the installed version and whether rejection originates in this middleware or upstream before changing it. express-http-proxy documentation.
Hosted services and browser clients
For hosted APIs or Git uploads, identify the failing endpoint and receiving service. Check that service’s body-size allowance and any intervening proxy; a header quota is not a body allowance.
In Chrome or Edge, open DevTools > Network before reproducing the failure. Select the failed upload and record its URL, method, status, response headers and body. Correlate its timestamp or request ID with server logs. Chrome Network reference; Edge Network reference.
When should you retry HTTP 413?
An unchanged request against an unchanged limit usually fails again. For temporary rejection, the server should send Retry-After. RFC 9110. Reflect that distinction in your retry policy.
Do not confuse body size with 431 header size, 414 URI length, 415 unsupported format, 422 semantic processing failures or 429 rate limiting.
After changing the limit, repeat the original upload and confirm application acceptance or storage. Then confirm that a request beyond the intended allowance remains rejected.
Frequently Asked Questions
Does HTTP 413 mean my file is corrupted?
It identifies a size rejection, not a file-integrity result. Locate the rejecting component before investigating unrelated content problems.
Why does a file below the advertised limit fail?
The complete request can exceed the file size because of fields, multipart overhead or encoding. Another layer may also enforce a lower limit.
Why does 413 persist after increasing a limit?
Confirm that the change applies to the actual route and running instance. Then check whether another component rejects the larger request.
Should I split the upload?
Only when the endpoint supports separate batches or an upload protocol with reassembly. Arbitrarily cutting a request can change its meaning.
Does 413 OK mean the upload succeeded?
Treat the numeric 413 as failure. Inspect the response and confirm application acceptance instead of trusting the accompanying label.
What evidence should I send to the site owner?
Include the time, endpoint, method, serialized body size in bytes and sanitized response. A smaller successful request on the same route helps isolate the threshold.
Last updated: November 18, 2026.
