Dokku: Fixing 413 "Request Entity Too Large" on File Uploads

Jun 9, 2026 00:01 · 92 words · 1 minute read

My Node.js app accepted an 8 MB image upload just fine locally, but the same upload failed with a 413 Content Too Large HTTP error on my Dokku-hosted instance.

The reason: Dokku puts an nginx reverse proxy in front of your app, and nginx’s default client_max_body_size is just 1 MB. Anything larger gets rejected by nginx itself.

The fix is a per-app nginx setting:

1
2
dokku nginx:set <app-name> client-max-body-size 16m
dokku proxy:build-config <app-name>

Useful: dokku nginx:show-config <app-name> prints the full generated nginx config, incl. the value for client_max_body_size.

(via Dokku docs)