Elastic beanstalk上Spring boot应用上传大文件,nginx报错

问题描述 投票:0回答:0

我写信给你是希望在我面临的问题上得到帮助,所以基本上我为我的应用程序创建了一个 spring boot rest API 并且我使用 AWS Elasticbeanstalk 进行部署,现在当我尝试将文件上传到我的 S3 存储桶使用 rest API,我遇到一个错误,说我的请求正文太大,即使对于一些不大于 1MB 的图像文件,这与 nginx conf 有关。那么请问我该如何解决这些问题。

这是应用程序日志的错误部分:2023/03/21 05:12:26 [error] 2736#2736: *56 client intended to send too large body: 3527163 bytes, client: ..., server: ,请求:“POST /mobile/create_post HTTP/1.1”,主机:“...”

.platform/nginx/conf.d/proxy.conf内容:client_max_body_size 50M; 在使用“mvn clean install”构建 jar 文件之前,我通过将 .conf 文件添加到我的项目根文件夹来尝试此解决方案,然后部署到弹性 beanstalk。但它没有用

我试过的第二个解决方案,它没有用 .ebextensions/nginx/nginx.conf 内容:client_max_body_size 50M;

spring-boot amazon-elastic-beanstalk nginx-reverse-proxy
© www.soinside.com 2019 - 2024. All rights reserved.