On this page
What this issue is
Every web server, proxy and CDN sets a maximum size for what it accepts. When a request goes over that size, it is rejected before your site code runs. The two status codes are:
| Code | Meaning | Typical cause |
|---|---|---|
| 413 | Content Too Large / Payload Too Large: the request body is over the limit | File uploads in forms, large JSON or base64 images, small default limits (Nginx defaults to 1 MB) |
| 431 | Request Header Fields Too Large: the headers are over the limit | Too many or too big cookies, long query strings, very long tracking parameters |
Why it costs you leads or sales
- Visitor fills formAttaches a 6 MB photo
- SubmitBrowser sends the request
- Server limitReturns 413 Payload Too Large
- Form handlerNever runs
- Email and CRMNo lead recorded
The request is rejected at the server, so the form handler and CRM never see it.
The visitor sees an error and the lead is gone.
How to check if your site has it
Reproduce it
Submit your form with a large attachment (try 5 to 10 MB), then with none. If only the large one fails, a body limit is the cause.
Open browser DevTools
Go to the Network tab, submit again and look for a red request with status 413 or 431. The response headers often show which layer answered (nginx, cloudflare, awselb).
Check the server logs
Nginx logs 'client intended to send too large body' in error.log. Apache logs 'Request body exceeds' or 'request header field is too long'.
Check cookie size for 431
In DevTools, Application, Cookies, see how many cookies your domain sets. Several kilobytes in total can trigger a 431.
How to fix it
Raise PHP limits
Set upload_max_filesize and post_max_size in php.ini, .user.ini or your host's PHP settings panel. post_max_size must be at least as big as upload_max_filesize.
Raise the web server limit
If you are behind Nginx, set client_max_body_size (see Custom code). Many managed hosts let you change this in their dashboard or through support.
Check form plugin settings
Your form plugin may have its own maximum file size. Align it with the server limits.
You cannot change server limits
Shopify sets them. Reduce file size on custom upload apps, and limit the number and size of cookies set by apps and scripts.
Remove cookie-heavy apps
If visitors get 431, disable recently added apps or scripts one at a time and retest.
Limit file upload size
Webflow sets the limits. Tell users the maximum file size on the form, and compress files before upload.
Check third-party form backends
If the form posts to an external service, check that service's request size limit.
Look for oversized tracking requests
Tags that send very long query strings or many custom parameters can create 431 or 414 errors on the receiving endpoint. Trim the payload or send it as POST.
Reduce cookies set by tags
Review tags that write many cookies and remove ones you do not need.
Nginx
Set client_max_body_size in the http, server or location block (for example 20m) for 413. For 431, raise large_client_header_buffers (for example 4 16k). Then run nginx -t and reload.
Apache
Set LimitRequestBody (bytes) for 413 and LimitRequestFieldSize for 431, then restart Apache.
Load balancer or CDN
Cloud CDNs and proxies have their own caps that may not be raisable on lower plans. If so, upload files directly to storage (for example with a signed upload URL) instead of through your server.
server {
client_max_body_size 20m;
large_client_header_buffers 4 16k;
}upload_max_filesize = 20M
post_max_size = 25MList your cookies
Find the largest cookies in DevTools and who sets them.
Remove or shorten them
Stop storing large data in cookies. Keep an ID in the cookie and the data on the server.
Scope cookies correctly
Set cookies on the narrowest domain and path so that sibling subdomains do not send each other's cookies.
How to confirm it's fixed
- Submit the form with a file just under your new limit and see a success message
- DevTools shows a 200 or redirect, not 413
- The test lead arrives in the inbox and CRM
- A browser with many existing cookies loads the site without a 431
- A file over the limit shows a clear message, not a server error page
How to prevent it happening again
Before
- Server default 1 MB body limit
- Photo uploads fail with 413
- No lead, no alert
After
- Limits aligned across CDN, server and PHP
- Size hint shown beside the field
- Uploads succeed and leads arrive
How FunnelGuard handles this
Questions people ask
What does 413 Request Entity Too Large mean?
It means the server or a proxy refused your request because the body was larger than its allowed maximum. It most often happens when uploading a file through a form. Raising the limit in the layer that returned the error fixes it.
How do I fix 413 Request Entity Too Large in Nginx?
Set client_max_body_size in the http, server or location block, for example 20m. Run nginx -t to check the config and reload Nginx. Also raise upload_max_filesize and post_max_size in PHP if you use it.
Why is my form not submitting with a large file?
A limit on the server, PHP, a CDN or the form plugin is probably refusing the upload. Open DevTools, Network, and look for a 413 response. Compare the file size with each layer's limit.
What is a 431 Request Header Fields Too Large error?
It means the request headers, often the cookies, were bigger than the server accepts. It can affect a returning visitor on every page. Clearing cookies helps short term, and reducing cookie size fixes it for good.
Why do I get 431 errors only on some browsers?
Those browsers hold more or larger cookies for your domain, so their headers exceed the limit while a fresh browser does not. Check the cookies in DevTools and remove oversized ones.
Is it safe to set a very high upload limit?
It is better to set the smallest limit that fits your real use. Very high limits make it easier for someone to tie up your server with huge uploads. Pair a moderate limit with file type checks.
Can I fix a 413 on Shopify or Webflow?
You cannot change their server limits. Reduce file sizes, state the maximum on the form and cut cookies from apps or scripts. For big files, use an external upload service.
Can FunnelGuard detect 413 and 431 errors?
Yes. If a monitored journey step returns one of these errors, it fails and you get an alert with a screenshot and likely cause after a second-region re-check.
Related issues
- OPS-086Large uploads rejected (upload_max_filesize)Fix guide
- OPS-094Rate limiting on host blocks normal visitorsFix guide
- OPS-097Wrong content-type headers (page downloads instead of rendering)Fix guide
- OPS-084Error display on (PHP warnings shown to visitors)Fix guide
- OPS-090One bad node behind load balancer (random failures)Fix guide
- OPS-072Server out of disk space (uploads, sessions fail)Fix guide