node.jsnginxdigital-oceandokku

Dokku (Digital Ocean) client_max_body_size node.js


So I've just pushed my app to Dokku (Digital Ocean) - and get the following error returned from an ajax post:

POST http://example.com/foo 413 (Request Entity Too Large)

A quick google shows this problem is due to client_max_body_size being too low. So I've SSH'd into the server, opened up the apps nginx.conf and increased it as per instructions here:

client_max_body_size 100M;

https://github.com/progrium/dokku/issues/802

However, I still have the same problem... Do I need to restart a process or something? I tried restarting the dokku app - but all this did was to overwrite my nginx.conf file.


Solution

  • This has been updated in Dokku and can be done from the CLI: dokku nginx:set node-js-app client-max-body-size 50m. https://dokku.com/docs/networking/proxies/nginx/#specifying-a-custom-client_max_body_size