解决413 Request Entity Too Large nginx/1.14.0
解决方法:
nginx的error.log的错误日志:
2018/10/17 16:31:45 [error] 23693#0: *76448222 client intended to send too large body: 1329896 bytes, client: 192.168.1.101, server: , request: "POST /shortMessage HTTP/1.1", host: "192.168.1.113:8500"
其中1329896 bytes是1.2M,也就是说请求的数据达到了1.2M,超过了nginx的默认上传文件大小限制,默认1M.
修改配置如下:
1.在nginx.conf的http中添加以下配置:
client_body_buffer_size 128k;
client_max_body_size 16m;
2.在tomcat的Connector中添加以下属性:
maxPostSize="-1"
本文链接:http://www.yayihouse.com/yayishuwu/chapter/1641