项目场景: 接收excel文件 问题描述 调用该接口时发生413错误 接口服务Nginx日志 2022/09/09 07:02:18 [error] 10#10: *6 client intended to send too large
接收excel文件
调用该接口时发生413错误
2022/09/09 07:02:18 [error] 10#10: *6 client intended to send too large body: 3501022 bytes, client: 192.168.7.1, server: data-dispatch-center, request: "POST /api/v1/app/fORM/excel_import?nonce=p3cNGR×tamp=1662678138.514602 Http/1.1", host: "10.11.206.141:3121"2022/09/09 07:02:23 [error] 10#10: *7 client intended to send too large body: 3501022 bytes, client: 192.168.7.1, server: data-dispatch-center, request: "POST /api/v1/app/form/excel_import?nonce=p3cNGR×tamp=1662678138.514602 HTTP/1.1", host: "10.11.206.141:3121"2022/09/09 07:02:28 [error] 10#10: *8 client intended to send too large body: 3501022 bytes, client: 192.168.7.1, server: data-dispatch-center, request: "POST /api/v1/app/form/excel_import?nonce=p3cNGR×tamp=1662678138.514602 HTTP/1.1", host: "10.11.206.141:3121"2022/09/09 08:23:15 [error] 10#10: *13 client intended to send too large body: 3432243 bytes, client: 192.168.7.1, server: data-dispatch-center, request: "POST /api/v1/app/form/excel_import?nonce=pszvLM×tamp=1662682994.933834 HTTP/1.1", host: "10.11.206.141:3121"2022/09/09 08:23:20 [error] 10#10: *14 client intended to send too large body: 3432243 bytes, client: 192.168.7.1, server: data-dispatch-center, request: "POST /api/v1/app/form/excel_import?nonce=pszvLM×tamp=1662682994.933834 HTTP/1.1", host: "10.11.206.141:3121"2022/09/09 08:23:25 [error] 10#10: *15 client intended to send too large body: 3432243 bytes, client: 192.168.7.1, server: data-dispatch-center, request: "POST /api/v1/app/form/excel_import?nonce=pszvLM×tamp=1662682994.933834 HTTP/1.1", host: "10.11.206.141:3121"
众所周知,413含义是“Request Entity Too Large”
nginx 配置文件中的client_max_body_size是控制请求body的大小限制的参数,默认为1MB,如果超过这个数值,则会直接返回413状态码
修改nginx配置文件
http { ... client_max_body_size 20M;}
参考:
http://nginx.org/en/docs/http/ngx_http_core_module.html
https://stackoverflow.com/a/62985236
来源地址:https://blog.csdn.net/MacwinWin/article/details/126776094
--结束END--
本文标题: 【Nginx】解决413错误
本文链接: https://lsjlt.com/news/376983.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0