Scaleup Infotech
Scaleup Infotech.
Back to Blog
Bug Fixes6 min read

Fix '413 Request Entity Too Large' on File Uploads

Scaleup Infotech

Scaleup Infotech

Software & Marketing Agency

Apr 17, 2026
Fix '413 Request Entity Too Large' on File Uploads
NginxPHPUploadsDevOps

A 413 means some layer between the browser and your code rejected the request body for being too large. You usually have to raise the limit in two or three places — Nginx, PHP, and the framework.

The Error

413 Request Entity Too Large

Fix 1: Nginx

nginx
http {
    client_max_body_size 50M;   # in the http, server, or location block
}

Then reload: sudo nginx -t && sudo systemctl reload nginx.

Fix 2: PHP (if applicable)

ini
; php.ini
upload_max_filesize = 50M
post_max_size = 52M     ; must be >= upload_max_filesize

Fix 3: Node / Express

javascript
app.use(express.json({ limit: "50mb" }));
app.use(express.urlencoded({ limit: "50mb", extended: true }));

Restart Everything

PHP changes need an php-fpm restart; Nginx needs a reload. Forgetting to restart is why people think the fix 'didn't work'.

Share this article:

Keep Reading

Ready to implement these ideas?

Work With Scaleup Infotech