8

I am using Golang with elastic Beanstalk and I find that I am able to upload files up to 1 MB and the ones bigger than that fail with the error client intended to send too large body: 1749956 bytes the bytes obviously depend on the file size . I have been reading this post Increasing client_max_body_size in Nginx conf on AWS Elastic Beanstalk and I changed my code created a file 01_nginx.config under the ebExtensions and put the following in it and I try to upload a video of 3 MB and it still gives that error, any suggestions ? I am new to this

files:
    "/etc/nginx/conf.d/proxy.conf" :
        mode: "000755"
        owner: root
        group: root
        content: |
           client_max_body_size 20M;
user1591668
  • 2,591
  • 5
  • 41
  • 84
  • 1
    did you try out the other solutions from the page out? Specifically, I'm wondering whether [this](https://stackoverflow.com/questions/18908426/increasing-client-max-body-size-in-nginx-conf-on-aws-elastic-beanstalk#answer-42992106) could work for you since it is specific to Go. – progfan May 17 '18 at 03:47
  • @progfan Thanks a lot I did that and it worked ! – user1591668 May 17 '18 at 04:31

1 Answers1

16

I have tried all .ebextensions method of adding implementation level configuration for rails and it didn't help me in the latest Amazon Linux AMI. For the latest Amazon Linux AMI You need to follow this structure to increase the upload size. You need to follow this structure to increase the upload size limit.

Add the below folder setup in the root level of your project folder.

Folder structure (.platform/nginx/conf.d/proxy.conf)

.platform/
         nginx/
              conf.d/
                    proxy.conf

Add this line to proxy.conf (Inside .platform/nginx/conf.d/ folder)

client_max_body_size 50M;

commit this file and deploy again using eb deploy.