Increase request size limit in aws beanstalk for .net core api

Viewed 837

I have a .Net core api installed on AWS Beanstalk. I am getting error "client intended to send too large body: 10181136 bytes" on uploading large file. How to increase max request size.

I tried creating ngnix.config file under .ebextensions folder with below configuration

files:
  /etc/nginx/conf.d/proxy.conf:
    content: |
      client_max_body_size 50M;

it didn't work for me.

1 Answers

A likely reason why it does not work for you is that the nginx setting you are trying to use (/etc/nginx/conf.d/proxy.conf) is for the older EB platforms based on Amazon Linux 1 (AL1).

But .NET Core platform is based on Amazon Linux 2 (AL2) as listed here. In this case, you should be using different files for customizing nginx. For AL2, the nginx settings should be in .platform/nginx/conf.d/, not in .ebextentions as shown in the docs.

Therefore, you could try creating the following file .platform/nginx/conf.d/myconfig.conf with content:

client_max_body_size 50M;
Related