antpaw
antpaw

Reputation: 15985

413 Request Entity Too Large in Nginx and Amazon ElasticBeanstalk

There are a lot of answers to this problem (question 1 question 2) but this solution that should work, doesn't work for me:

files:
  "/etc/nginx/conf.d/proxy.conf" :
    mode: "000755"
    owner: root
    group: root
    content: |
        client_max_body_size 50M;

I have checked the status and contents of this created file via ssh and its correct. I also have tried other values and restarted the server multiple times.

client_max_body_size 0;

or

http {
   client_max_body_size 50M;
}

This values do not work either.

it just wont work, even with "just" a 6mb image. it work with smaller images around size of 0.5mb. It's a RoR app with "64bit Amazon Linux 2018.03 v2.8.0 running Ruby 2.5 (Puma)". The instance size is t2.micro.

Upvotes: 7

Views: 3940

Answers (1)

Nipun Chawla
Nipun Chawla

Reputation: 366

Try this. It worked for me:

content: |
    server {
        ***your server configuration***

        location / {
             client_max_body_size 100M;
        }
    }

Upvotes: 6

Related Questions