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 header | Layer that sends the 413 | Issue |
|---|---|---|
cloudflare | Cloudflare proxy | Issue 1 |
Apache/... | Apache in your container (for example WordPress) | Issue 2 |
nginx | Nginx in your container | Issue 3 |
No Server header | A Traefik buffering middleware | Issue 4 |
| Other, or the response comes from a security rule | A web application firewall (WAF) | Issue 5 |
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
-
Check the error code:
- 413 = Payload Too Large (this guide)
- 504 = Gateway Timeout. The upload takes too long. Refer to Gateway Timeout Errors.
- 502 = Bad Gateway. Refer to Bad Gateway Errors.
-
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)
-
Check the
Serverheader of the 413 response. Refer to Find the Layer That Sends the Error.
Support
If these solutions do not fix your 413 errors:
- Join our Discord community and include the response headers of the 413 error.
- Search the GitHub issues for similar problems.
Gateway Timeout Errors
Resolve Gateway Timeout (504) errors in Coolify by fixing network isolation, adjusting proxy timeouts for Traefik, Caddy, and Nginx.
Too Many Redirects
Fix ERR_TOO_MANY_REDIRECTS and Cloudflare redirect loops by checking SSL/TLS encryption mode, HTTPS redirects, and Cloudflare Tunnel settings.
