1

We have an application running on ECS with an Application Load Balancer in front of it. We have a public-facing RESTful API that allows uploading certain types of files.

When sending a file larger than ~1 MB to the Load Balancer, the client receives a 413 Request Entity Too Large response. This does not happen when directly sending the file to the application's web server.

Is there any way to increase the maximum size of the request body on the ELB?

So far I was only able to find solutions when using Elastic Beanstalk (by providing some nginx configuration in the .ebextension directory of the distribution).

Sebastian Heuer
  • 1,022
  • 1
  • 11
  • 17
  • What do you see in your application server's log when this happens? Anything? There's no documented 1MB limit in ELB. – Michael - sqlbot Oct 19 '16 at 19:59
  • Can you please take a look at the Monitoring tab of the ELB at the time of an event and advise if the 4XX error is appearing under the "Sum HTTP 4XX Errors" metric or the "Sum ELB 4XX errors" metric. HTTP means the error was thrown by your application servers, ELB means the error was thrown by the ELB. Can you also confirm all your backend instances are healthy and that there are no "Backend Connection Errors" in your ELB Monitoring too at the time of the event. – Xavier Hutchinson Oct 25 '16 at 08:30
  • Had the same problem and [this answer](http://stackoverflow.com/a/18951706/688869) did the trick for me. – Udo G Mar 07 '17 at 08:19

1 Answers1

2

Two years later too late, but hope this helps someone. We have a nodejs server on Elastic Beanstalk. Got the same problem when uploading an image > 1MB. We use bodyParser, so we set the limit to be 5mb, in our case, which works.

app.use(bodyParser.urlencoded({ extended: true }));

app.use(bodyParser.json({ limit: '5mb' })); //1MB by default

Community
  • 1
  • 1
Ervi B
  • 770
  • 7
  • 16