我按照这里的建议配置 nginx 反向代理以允许大于默认 1mb 的文件。因此,我的代码
/.platform/nginx/conf.d/prod.conf
如下所示:
http {
client_max_body_size 30M;
}
但是,这似乎没有任何效果,当我尝试上传大于 1mb 的文件时,nginx 仍然会报错。
我也尝试在没有和大括号的情况下执行此操作,如对此问题http
的已接受答案中所述,如下所示:
client_max_body_size 30M;
这也没有效果。
我认为应用配置后可能需要重新启动 nginx,所以我在 .ebextensions 目录中添加了一个名为 的文件,01nginx.config
如下所示:
commands:
01_reload_nginx:
command: "sudo service nginx reload"
这也没有效果。
我已经看过这个问题和上面提到的问题,以及这个问题。但是,它们似乎都已过时或不适用于 Amazon Linux 2 实例,因为它们都没有提到.platform
上述弹性 beanstalk 文档中的目录。无论如何,到目前为止,他们的答案都没有对我有用。那么,我错过了什么?