Default Request Size Limits: Nginx, Apache, PHP, Cloudflare and More

Every layer an upload passes through can reject it for being too big — and each one has its own default. This page collects those defaults in one place: web servers, PHP, security modules, CDNs, application frameworks and serverless platforms.

The limit that applies is always the smallest one on the path, so a 2 GB setting in your app means nothing if the proxy in front of it stops at 1 MB. When a request is rejected, most layers return HTTP 413 Content Too Large — our guide to that error shows how to find which layer said no.

This page is part of our series of server references, alongside default timeouts, control panel ports and how to verify search engine and AI crawlers.

Last verified: September 2026. Defaults change between versions — each value below is the default for current releases unless a version is noted. Check your own configuration before relying on a default: hosting providers and distributions often change them.

Default request size limits: the reference

Web servers and proxies

LayerSettingDefaultWhen exceeded
Nginxclient_max_body_size1 MB413
Apache HTTP Server 2.4.54+LimitRequestBody1 GB413
Apache HTTP Server before 2.4.54LimitRequestBodyUnlimited—
Caddyrequest_body max_sizeUnlimited413 if set
Microsoft IISmaxAllowedContentLength30,000,000 bytes (≈28.6 MB)404.13
Kubernetes ingress-nginxproxy-body-size annotation1 MB413

PHP

SettingDefaultWhat it limits
upload_max_filesize2 MBEach uploaded file
post_max_size8 MBThe whole POST body, files included
max_file_uploads20Number of files per request
memory_limit128 MBMemory per script — can matter for large uploads

PHP rarely returns a 413. When post_max_size is exceeded, PHP drops the data and the application reports its own error — in WordPress, “The link you followed has expired.” WordPress Multisite adds one more limit: Max upload file size in Network Settings, 1,500 KB by default.

Security modules and CDNs

LayerSettingDefaultWhen exceeded
ModSecurity (recommended config)SecRequestBodyLimit12.5 MB (13,107,200 bytes)413
ModSecurity (recommended config)SecRequestBodyNoFilesLimit128 KB (131,072 bytes) — body without files413
Cloudflare Free and ProPlan limit100 MB413
Cloudflare BusinessPlan limit200 MB413
Cloudflare EnterprisePlan limit500 MB by default, raisable413

The ModSecurity values come from modsecurity.conf-recommended, the configuration almost every installation starts from. Cloudflare’s limits apply only to proxied (orange-cloud) records, and a zone can lower them further in its network settings.

Application frameworks

FrameworkSettingDefaultWhen exceeded
Express (Node.js)express.json() / express.urlencoded() limit100 KB413 PayloadTooLargeError
Fastify (Node.js)bodyLimit1 MB413
Node.js http module—No body limit—
DjangoDATA_UPLOAD_MAX_MEMORY_SIZE2.5 MB (excludes file uploads)400 RequestDataTooBig
FlaskMAX_CONTENT_LENGTHNo limit413 if set
Spring Bootspring.servlet.multipart.max-file-size / max-request-size1 MB / 10 MBException, usually a 413 or 500
Apache TomcatmaxPostSize2 MB — form data onlyParameters silently ignored
ASP.NET Core (Kestrel)MaxRequestBodySize30,000,000 bytes (≈28.6 MB)413
ASP.NET (.NET Framework)maxRequestLength4 MB (4,096 KB)Exception

Serverless platforms

PlatformLimitDefault
Vercel FunctionsRequest body4.5 MB
AWS Lambda (synchronous invoke)Request payload6 MB
Amazon API Gateway (REST)Payload10 MB
AWS Application Load Balancer → Lambda targetRequest body1 MB
Google Cloud Run (HTTP/1)Request size32 MB

Serverless limits usually can’t be raised. The standard workaround is to upload directly to object storage with a signed URL, and send the function only the file’s location.

Header size limits

A request can also be rejected for headers that are too big — usually because of large or numerous cookies, or long tokens. The status is 431 by the standard, though several servers answer with 400.

LayerSettingDefaultWhen exceeded
Nginxlarge_client_header_buffers4 × 8 KB400 “Request Header Or Cookie Too Large”
ApacheLimitRequestFieldSize8,190 bytes per header400
Node.js--max-http-header-size16 KB total431
Cloudflare—32 KB total, 16 KB per header431 / 400

The limit that wins is the smallest one

A request passes every layer on its way to the application, and each can reject it. A typical path for a WordPress site behind Cloudflare looks like this:

Visitor → Cloudflare (100 MB) → Nginx (1 MB) → PHP (8 MB post, 2 MB file) → WordPress

Here, any upload over 1 MB fails at Nginx — no matter what PHP or Cloudflare would allow. Raising PHP’s limit to 64 MB changes nothing until Nginx’s does too.

That’s why “I raised the limit and it still fails” is so common: the setting that was raised isn’t the smallest one on the path.

Timeouts work the same way: the shortest one on the path decides where a slow request fails. Our reference of default timeouts covers them layer by layer.

How to find which limit you hit

The error page tells you most of the time. A plain page with nginx at the bottom is Nginx; a Cloudflare-branded page is Cloudflare; a framework’s JSON error is the application. For the full diagnosis — reading logs, testing with curl, and fixing each layer — see our guide to HTTP 413 Content Too Large.

Choosing a safe limit

Set each limit to your largest legitimate upload, plus a margin — and no higher. Large body limits make it easier to tie up a server with oversized requests. Where the software allows it, raise the limit only on the path that accepts uploads — an Nginx location block, a specific API route — and keep the rest of the site at a small default.

Sources

Set every limit yourself

A Copahost VPS gives you root access to Nginx, Apache, PHP and ModSecurity — so the upload limit is the one you choose, per site and per path. On shared hosting, PHP limits are adjustable per domain in cPanel’s MultiPHP INI Editor.

See VPS plans →

Frequently asked questions

What is the default max body size in Nginx?
1 MB. It’s set by client_max_body_size, and any request body larger than that is rejected with a 413. Raise it in the http, server or location block.

What is the default upload limit in PHP?
2 MB per file (upload_max_filesize) and 8 MB for the whole POST body (post_max_size), with up to 20 files per request. Many hosts raise these defaults, so check your own configuration.

What is Cloudflare’s maximum upload size?
100 MB on the Free and Pro plans, 200 MB on Business and 500 MB by default on Enterprise. The limit applies only to proxied records; uploads through a DNS-only record bypass it.

Why does my upload still fail after raising the limit?
Because another layer on the path has a smaller one. The limit that applies is always the smallest between the visitor and the application — often Nginx’s 1 MB default, even when PHP and Cloudflare allow far more.

What is the default body limit in Express?
100 KB for both express.json() and express.urlencoded(). Requests above it fail with PayloadTooLargeError and a 413; raise it with the limit option.

Conclusion

Request size limits are small by design, and there are more of them than most people expect. The one that applies is always the smallest on the path — which is why raising a limit so often seems to do nothing: the setting that changed wasn’t the one blocking the request.

Four defaults cause most of the trouble. Nginx’s 1 MB client_max_body_size, PHP’s 2 MB per file and 8 MB per post, Express’s 100 KB body parser, and the serverless limits that can’t be raised at all. Check those first, and the rest of the table usually doesn’t come into play.

When you raise a limit, raise it along the whole path — proxy, web server, PHP or framework — and only as far as your largest real upload needs, ideally just on the route that accepts it. And when a request still fails, the error page usually names the layer: our guide to HTTP 413 shows how to read it.

Share the Post:
Picture of Gustavo Gallas

Gustavo Gallas

Graduated in Computing at PUC-Rio, Brazil. Specialized in IT, networking, systems administration and human and organizational development​. Also have brewing skills.