Fix Nginx 413 Request Entity Too Large
Allow larger uploads by raising `client_max_body_size` in the right server block.
Problem
POSTing a file larger than ~1 MB returns `413 Request Entity Too Large`.
Root cause
Nginx defaults `client_max_body_size` to 1 MB. Any larger request body is rejected before reaching the upstream.
Solution
Raise the limit in the right scope
http {
client_max_body_size 50m; # global default
}
server {
client_max_body_size 200m; # override for this vhost
}Reload Nginx
sudo nginx -t && sudo systemctl reload nginxFrequently asked questions
Related fixes
Nginx
5 minFix Nginx 502 Bad Gateway
Nginx is healthy, but every request 502s. The upstream is the suspect — here's how to confirm and fix.
#502#upstream#proxy
Nginx
5 minFix Nginx SSL Handshake Failures
TLS errors from clients or curl, and how to read OpenSSL output to pinpoint the cause.
#ssl#tls#openssl
Weekly digest
One DevOps fix in your inbox each week
Short, practical, no fluff. Real errors, real fixes — straight from production postmortems.