I'm running into "413 Request Entity Too Large" errors when posting files larger than 10MB to our API running on AWS Elastic Beanstalk.
I've done quite a bit of research and believe that I need to up the client_max_body_size for Nginx, however I cannot seem to find any documentation on how to do this using Elastic Beanstalk. My guess is that it needs to be modified using an ebetension file.
Anyone have thoughts on how I can up the limit? 10MB is pretty weak, there has to be a way to up this manually.
Following on from the accepted answer, you need may need to reload the nginx config file.
In order to do this add the following command
This would be better practice than ssh'ing into your eb instance and manually doing it with a command.
This combined with the accepted answer solved the same issue for me. (Rails, Puma, NGINX)
Modified the above answer for the sake of security (and the syntax was wrong, see, two 'owner:' entries in the YAML), guys, please don't set 777 permissions on ANYTHING. Unless you enjoy being hacked, and set the owner of Nginx config files to root.
Also see the below answer to make nginx pickup this change after deployment.
For Golang without Docker I followed these instructions from aws doc:
I created the file
proxy.conf
in.ebextensions/nginx/conf.d/
at the root of my project, with simply 1 line inside:If it still doesn't work, make sure
.ebextensions
folder and sub-folders are included in your deployment zip. No need to restart Nginx manually.