Customizing Nginx Configuration in AWS Elastic Beanstalk

后端 未结 6 1894
庸人自扰
庸人自扰 2021-02-01 23:58

I\'m running a rails application on Ruby 2.0/Puma instances and am trying to customize the nginx configuration. I need to increase the permitted request size to allow file uploa

6条回答
  •  旧时难觅i
    2021-02-02 00:23

    I had a similar situation with a Docker deployment into Elastic Beanstalk. I was able to solve the change as well as the nginx reload with a single config file here: /.ebextensions/increase_upload_size.config including the following code:

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

    The change was implemented when I did an "Upload and Deploy" within EB.

提交回复
热议问题