3

I know this might be considered a duplicate of: Customizing Nginx Configuration in AWS Elastic Beanstalk (and other questions), but I was unable to make my code work with any of the proposed solutions.

This is how my config.yml file looks like (xxx = environment name):

branch-defaults:
    master:
        environment: xxx
    environment-defaults:
      xxx:
        branch: master
        repository: xxx
    global:
      application_name: xxx
      default_ec2_keyname: null
      default_platform: arn:aws:elasticbeanstalk:eu-west-1::platform/Node.js running on
        64bit Amazon Linux/4.3.0
      default_region: eu-west-1
      instance_profile: null
      platform_name: null
      platform_version: null
      profile: null
      sc: git
      workspace_type: Application

Then adding:

http:
  files:
    "/etc/nginx/conf.d/proxy.conf" :
      mode: "000755"
      owner: root
      group: root
      content: |
          http {
            client_max_body_size 20M;
          }
container_commands:
  01_reload_nginx:
    command: "service nginx reload"

For allowing bigger payloads and trying to restart nginx to accept the changes after deploy. However, even though it seems the accepted method it is not working in my code. Everything else works perfectly fine with smaller files than 1mb.

Thanks for your help!

Jan Runo
  • 45
  • 6
  • Have you tried to increase client_max_body_size to 50M ? – Carca Nov 08 '17 at 12:53
  • I was sending a file of 3mb. Do you think 20 vs. 50 makes a difference there? – Jan Runo Nov 08 '17 at 13:13
  • @JanRuno did you find any solution? – Zicsus Aug 29 '18 at 15:16
  • 1. Open `.ebextensions` and verify nginx config file name. It must end with `.config`. 2. Verify that `.ebextensions` content is copied inside app package. 3. ssh to ec2 instance and verify that file `/etc/nginx/conf.d/proxy.conf` is created after deployment. – naXa Mar 02 '19 at 23:53
  • 4. `.ebextensions` should be placed in the root of the app package. – naXa Mar 03 '19 at 00:27

0 Answers0