Payload Too Large (413) Errors

A 413 error occurs when a layer between the browser and your application rejects a request because its body is too large. Usually this occurs when you upload a large file.

The Coolify proxy (Traefik or Caddy) does not set a limit on the request body size. Thus, the 413 error comes from a different layer: a CDN in front of your server, the web server in your container, or a limit that you added.

Find the Layer That Sends the Error

Look at the Server header of the 413 response. Use the network tab of your browser, or send a large request with curl:

# Make a 150 MB test file and send it to your application
head -c 150M /dev/zero > /tmp/big.bin
curl -s -D - -o /dev/null --data-binary @/tmp/big.bin https://your-domain.com/

Find the Server header in the output, then go to the related issue:

Server headerLayer that sends the 413Issue
cloudflareCloudflare proxyIssue 1
Apache/...Apache in your container (for example WordPress)Issue 2
nginxNginx in your containerIssue 3
No Server headerA Traefik buffering middlewareIssue 4
Other, or the response comes from a security ruleA web application firewall (WAF)Issue 5
Note

If you do not get a 413 error, make the test file larger than the size at which your uploads fail. Other errors (for example 404 or 405) are not important here, because the request went through all limits.

Quick Diagnosis Checklist

  1. Check the error code:

  2. Check the size at which uploads fail:

    • Approximately 100 MB, 200 MB, or 500 MB = Cloudflare (Issue 1)
    • Approximately 1 MB = Nginx (Issue 3)
    • Approximately 1 GiB = Apache (Issue 2)
  3. Check the Server header of the 413 response. Refer to Find the Layer That Sends the Error.

Support

If these solutions do not fix your 413 errors:

On this page