我在我的项目中上传大图像时遇到问题,我的配置是使用 puma 和 RoR。我在 elasticbeanstalk 中的用户是 ec2-user。
我已经尝试过许多我看到的配置,但它无法正常工作。 .ebextensions 中的文件如下所示:
files:
"/etc/nginx/conf.d/proxy.conf" :
mode: "000777"
owner: root
group: root
content: |
client_max_body_size 4G;
其他配置但不起作用
files:
"/etc/nginx/conf.d/proxy.conf" :
mode: "000755"
owner: ec2-user
group: ec2-user
content: |
client_max_body_size 50M;
文件已创建但未成功。有什么建议么?谢谢。
最佳答案
我已经用这个文件解决了这个问题:.ebextensions/01_files.config
container_commands:
01_reload_nginx:
command: "service nginx reload"
files:
"/etc/nginx/conf.d/proxy.conf":
mode: "000755"
owner: root
group: root
content: |
client_max_body_size 0;
关于ruby-on-rails - 如何解决 Nginx 和 Amazon ElasticBeanstalk 中的错误 413 Request Entity Too Large?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28030736/