gpt4 book ai didi

amazon-web-services - AWS elastic beanstalk nginx 配置不适用于我的 Nodejs Web 应用程序

转载 作者:行者123 更新时间:2023-12-02 19:22:40 27 4
gpt4 key购买 nike

我正在为我的 Nodejs 网站使用 amazon elastic beanstalk,并以 nginx 作为代理。我想将最大上传大小设置为 20mb,因为默认大小为 1mb。我已尝试在 .ebextensions/.config 文件中设置 client_max_body_size 的所有可能方法。但似乎没有一个起作用,因为我仍然收到 413 错误。下面是我的配置文件


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;

最佳答案

/etc/nginx/conf.d/proxy.conf 适用于 Amazon Linux 1 (AL1)。但是,您可能正在使用当前版本的 EB(问题中未指定),即 Amazon Linux 2 (AL2)。

对于 AL2,您应该使用 the config files.platform/nginx/conf.d/ 中。

EB 中的 AL1 和 AL2 之间存在许多差异:

因此,如果您要将应用程序从 AL1 迁移到 AL2,您可能需要修改额外的文件才能使应用程序正常工作。

关于amazon-web-services - AWS elastic beanstalk nginx 配置不适用于我的 Nodejs Web 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62844969/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com