3

我知道这可能被视为重复:Customizing Nginx Configuration in AWS Elastic Beanstalk(和其他问题),但我无法使我的代码与任何建议的解决方案一起工作。

这就是我的 config.yml 文件的样子(xxx = 环境名称):

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

然后添加:

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"

允许更大的有效负载并尝试重新启动 nginx 以在部署后接受更改。但是,即使它似乎是公认的方法,它在我的代码中也不起作用。对于小于 1mb 的文件,其他一切都可以正常工作。

谢谢你的帮助!

4

0 回答 0