NGINX 413 Request Entity Too Large: Uploads Blocked

Symptom

Uploads above ~1MB fail with 413.

Root cause

client_max_body_size defaults to 1m.

Fix, in order

1. Raise the limit where uploads happen onlylocation /upload { client_max_body_size 50m; }
2. Do not set it to 0 globally without thought# 0 disables the check entirely
3. Reload and confirmnginx -t && nginx -s reload

Prevent it coming back

Match the limit to what your app actually accepts.

Run it on clean infra

Spinning up a fresh box to reproduce or escape this error?

Managed cloud hosting

Related

Cloud & DevOps tool comparisons · Hardware build guides

NinjaOps publishes free engineering guides. Some outbound links are affiliate links: they cost you nothing and support the site.

Last reviewed 2026-10-02 · NinjaOps SEO grid · DevOps blog