【发布时间】:2020-11-05 12:31:15
【问题描述】:
我有一个在 Elastic Beanstalk 上运行的 Node 10 应用程序,当请求负载大于 ~1MB 时,它会引发 413 错误。
<html>
<head>
<title>413 Request Entity Too Large</title>
</head>
<body>
<center>
<h1>413 Request Entity Too Large</h1>
</center>
<hr>
<center>nginx/1.16.1</center>
</body>
</html>
请求根本没有命中我的应用程序;它被 nginx 拒绝了。
我已尝试配置 AWS 以根据 this answer 增加允许的请求正文的大小,但无济于事。
我尝试在.ebextensions/01_files.config 添加一个文件,内容如下:
files:
"/etc/nginx/conf.d/proxy.conf" :
mode: "000755"
owner: root
group: root
content: |
client_max_body_size 20M;
那没有用,所以我尝试将文件直接添加到 .ebextensions/nginx/conf.d/proxy.conf,只使用:
client_max_body_size 20M;
这也不起作用。然后我通过 SSH 进入实例并直接添加文件。重新部署后,整个conf.d 目录被删除并重写,没有这个文件。
如何让 AWS Elastic Beanstalk 和 Node.js 10 在 64 位 Amazon Linux 2/5.1.0 上运行以接受 nginx 配置?
【问题讨论】:
标签: node.js amazon-web-services nginx amazon-ec2 amazon-elastic-beanstalk