大文件上传遇到的问题
昨天客户说大文件无法上传,我想起来ng中配置的是100m,就去ng中改了下client_max_body_size 300m;
再测测试,改报504超时了,继续在http{}中加
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
sendfile on; 上传加速
keepalive_timeout 1800;
继续测试,又报了另个错
Maximum upload size exceeded; nested exception is java.lang.IllegalStateException: org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (172928594) exceeds the configured maximum (62914560)
百度了下,是项目中配置的问题,修改application.properties中
spring.servlet.multipart.max-file-size=300MB
spring.servlet.multipart.max-request-size=300MB
以上具体修改的数值根据客户要求和服务器配置来