【问题标题】:unable to increase the client_max_body_size using the .ebextensions method无法使用 .ebextensions 方法增加 client_max_body_size
【发布时间】:2020-08-24 02:27:14
【问题描述】:

我尝试使用 .ebextension 文件夹方法将默认 client_max_body_size 增加到 50M,当我将 .zip 项目文件夹上传到 Elastic Beanstalk 时,conf 文件未部署。

我的 proxy.config 文件位于 .ebextensions 文件夹中

files:
    "/etc/nginx/conf.d/proxy.conf":
        content: |
           client_max_body_size 20M;

这对我不起作用。 我的 AMI:Node.js 12 在 64 位 Amazon Linux 2/5.0.0 上运行

【问题讨论】:

    标签: amazon-web-services amazon-elastic-beanstalk nginx-config


    【解决方案1】:

    这让我在第一次使用 AL2 上的 Node 12 构建时也被吸引了。

    最终解决方案是在我的项目中创建以下文件:

    /.platform/nginx/conf.d/myconf.conf

    在那里你只需要一行:

    client_max_body_size 20M;
    

    它对我有用,我希望它也对你有用。

    关于配置 Amazon Linux 2 平台的文档:

    https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/platforms-linux-extend.html

    (参见反向代理配置)

    【讨论】:

    • 感谢@mark.infinity,经过大量研究和多次尝试并交叉检查日志文件,我也找到了这个解决方案。我已经做到了,您回答了相同的解决方案,我将其作为正确答案。我们可能还需要添加service nginx reload 作为配置命令
    • 嗨 Jijo,很高兴你把它整理好了,感谢你将我的答案标记为答案,即使你独立得出了相同的结论。干杯M
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-03-16
    • 1970-01-01
    • 2018-10-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-07
    相关资源
    最近更新 更多