nginx - nginx ingress 中的 body 大小到底是多少?
问题描述
我正在尝试为 proxy-body-size 注释设置一个值,但我确定如何得出相同的数字。例如,如果我推送价值 2GB 的数据,则 1GB 的主体大小会引发“413 请求太大”错误,而 3GB 的限制可以正常工作。
所以我想了解nginx中的body size到底是什么。它是整个数据的数据包/较小部分还是整个数据(比如上面提到的我正在推动的 2GB)。
任何帮助将不胜感激。
解决方案
您必须在请求正文中设置允许的最大大小。因此,您必须将值设置为大于您尝试推送的数据大小。
Custom Body Size: For NGINX, an 413 error will be returned to the client when the size in a request exceeds the maximum allowed size of the client request body. This size can be configured by the parameter client_max_body_size.
To configure this setting globally for all Ingress rules, the proxy-body-size value may be set in the NGINX ConfigMap. To use custom values in an Ingress rule define these annotation:
nginx.ingress.kubernetes.io/proxy-body-size: 8m
推荐阅读
- mongodb - 出于分析和调查目的,维护我的 MongoDB 的编辑副本的最佳方法是什么?
- javascript - 当我点击它时,按钮颜色不会改变?
- python - Python - 拆分制表符分隔文件并转换为数据框
- java - Flyway 配置 java.lang.ClassNotFoundException: org.flyway.core.Flyway
- go - 如何在 golang/echo 中结合自定义 HTTP 错误处理程序触发 BasicAuth 提示?
- mysql - Laravel Docker SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known
- python-3.x - 使用 matplotlib .pylot 绘制直方图和位于直方图上的平滑曲线
- reactjs - 如何在 React Native 样式中将我的内容图像上移?
- python - Pandas DataFrame 按列值组合行,其中行可以有 NaN
- angularjs - 而不是 ng-repeat-start 在 VueJS 中使用嵌套的 v-for 循环