3

I have problems upload large images in my project, my configuration is with puma and RoR. My user in the elasticbeanstalk is ec2-user.

I've tried with many configurations that I saw, but it can't works properly. the file in the .ebextensions is like this one:

files:
  "/etc/nginx/conf.d/proxy.conf" :
    mode: "000777"
    owner: root
    group: root
    content: |
        client_max_body_size 4G;

Other configuration but it doesn't work

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

The file is created but without a successful. Any suggestions? Thanks.

Israel Barba
  • 1,434
  • 20
  • 28
  • Does this answer your question? [Increasing client\_max\_body\_size in Nginx conf on AWS Elastic Beanstalk](https://stackoverflow.com/questions/18908426/increasing-client-max-body-size-in-nginx-conf-on-aws-elastic-beanstalk) – rogerdpack Feb 09 '21 at 16:52

2 Answers2

4

I've already slove that with this file :.ebextensions/01_files.config

container_commands:
  01_reload_nginx:
    command: "service nginx reload"
files:
    "/etc/nginx/conf.d/proxy.conf":
      mode: "000755"
      owner: root
      group: root
      content: |
        client_max_body_size 0;
3

I've already resolved my problem, I had to add: client_max_body_size in the http

files:
  "/etc/nginx/conf.d/proxy.conf" :
    mode: "000755"
    owner: root
    group: root
    content: |
        http {
          client_max_body_size 20M;
        }
Israel Barba
  • 1,434
  • 20
  • 28