springboot 2.1.9上传文件太大报错Maximum upload size exceeded
解决方案
1. 查看tomcat是否有限制请求数据大小
在D:\RuanJian\Java\tomcat\conf\server.xml中
<!-- 我在这里修改了一下,maxPostSize="-1",-1表示不限制上传大小-->
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
maxPostSize="-1"
redirectPort="8443" />
2. springboot 设置请求大小限制
在application.properties配置
# 文件上传限制
spring.servlet.multipart.max-file-size=500MB
spring.servlet.multipart.max-request-size=500MB
3.查看Nginx 是否有限制请求数据大小
server {
listen 80;
#server_name localhost;
client_max_body_size 500M;
#charset koi8-r;
#access_log logs/host.access.log main;
location /test/ {
proxy_pass http://127.0.0.1:8080/test/;
}
}