问题描述
我正在尝试为proxy-body-size注释设置一个值,但是确定如何得出相同的数字。例如,如果我要推送价值2GB的数据,则1GB的主体大小会引发“ 413 Request too large”错误,而3GB的限制可以正常工作。
所以我想了解nginx中的人体尺寸到底是什么。是整个数据包还是整个数据包的一小部分/较小部分(例如,如上所述,我要推送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