MockFoxAdvertise

HTTP 413 Content Too Large (Payload Too Large)

Updated Free mock REST & WebSocket APIs

HTTP 413 Content Too Large — The request body is larger than the server is willing to accept.

Class
4xx Client Error
Defined in
RFC 9110 §15.5.14
Official
Yes (IANA registry)
Cacheable by default
No (unless Cache-Control/Expires say so)
Safe to retry
Not without changing the request

Try it: get a real 413 response

Our test endpoint answers every request with 413 Content Too Large.

curl -i https://mockfox.dev/api/status/413

Use it in tests, health-check monitors or to see how your client handles a 413. Add ?delay=2000 to slow it down.

What does HTTP 413 mean?

413 Content Too Large (called "Payload Too Large" in RFC 7231 and "Request Entity Too Large" in older specs and in nginx's error page) means the request body is bigger than the server is willing or able to process. The server may close the connection; if the condition is temporary it can send Retry-After.

The limit can sit at any layer: CDN, load balancer, reverse proxy, application server or framework body parser — whichever is smallest wins.

When is 413 used?

  • Uploading an image, video or file larger than the allowed size.
  • A large JSON body (bulk import, base64-encoded images) hitting a framework's body limit.
  • Serverless platforms with hard payload limits (AWS Lambda 6 MB synchronous; Vercel Functions 4.5 MB).

Common causes of a 413

  • nginx's client_max_body_size defaults to 1 MB — the most common culprit.
  • Express express.json() defaults to a 100 KB limit.
  • PHP's upload_max_filesize (2 MB default) and post_max_size (8 MB default) in WordPress hosting.
  • Cloudflare caps uploads at 100 MB on Free and Pro plans.

How to fix 413 Content Too Large

If you're visiting the site

  1. Compress or resize the file (e.g. reduce image resolution, zip documents) and try again.
  2. Split large uploads into several smaller files.
  3. Check the site's stated upload limit.

If you run the site or API (developers)

  1. Raise the limit at every layer in the chain, starting with the proxy.
  2. For big files, upload directly from the browser to object storage with presigned URLs instead of through your server.
  3. Validate size on the client first and show a clear message before uploading.
  4. Return a helpful body like {"error":"file_too_large","maxBytes":10485760}.

Returning or handling 413: server examples

nginx

http {
    client_max_body_size 50m;   # default 1m; 0 disables the check
}

Express

app.use(express.json({ limit: "10mb" }));          // default 100kb
app.use(express.urlencoded({ limit: "10mb", extended: true }));

Next.js

// next.config.ts — Server Actions body limit (default 1 MB)
export default {
  experimental: { serverActions: { bodySizeLimit: "10mb" } },
};

// Route handlers read the stream themselves; enforce your own cap:
export async function POST(req: Request) {
  if (Number(req.headers.get("content-length")) > 10_000_000)
    return Response.json({ error: "file_too_large" }, { status: 413 });
}

PHP (php.ini)

upload_max_filesize = 64M
post_max_size = 64M

Example 413 response

HTTP/1.1 413 Content Too Large
Connection: close
Content-Type: application/json

{"error":"file_too_large","maxBytes":10485760}

Related status codes

Related tools

Frequently asked questions

How do I fix "413 Request Entity Too Large" in nginx?

Set client_max_body_size (e.g. 50m) in the http, server or location block and reload nginx with nginx -s reload. The default is 1 MB.

Are 413 Payload Too Large and Request Entity Too Large the same?

Yes — same code, different names across spec versions. RFC 9110 calls it Content Too Large.

How do I fix 413 in WordPress?

Increase upload_max_filesize and post_max_size in php.ini (or via your host's panel), and client_max_body_size if the host uses nginx.