NGINX 上传文件413 405

概念

413   服务器无法处理请求,因为请求实体过大,超出服务器的处理能力。
405   禁用请求中指定的方法。

413 解决办法
配置文件 nginx.conf

 http{} 中添加   client_max_body_size 10m;

后端springboot也要配置下

#文件上传最大10M
spring.servlet.multipart.max-file-size = 10485760

405
nginx禁止用post访问静态资源,
在service{}中添加

 proxy_intercept_errors on;
 fastcgi_intercept_errors on;
 error_page 405 =200 $uri;

你可能感兴趣的:(nginx)