我正在尝试为 proxy-body-size 注释设置一个值,但我确定如何得出相同的数字。例如,如果我推送值(value) 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
关于nginx - nginx ingress 中的 body 大小到底是多少?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63399481/