nginx入口中的主体尺寸到底是多少?

问题描述

我正在尝试为proxy-body-size注释设置一个值,但是确定如何得出相同的数字。例如,如果我要推送价值2GB的数据,则1GB的主体大小会引发“ 413 Request too large”错误,而3GB的限制可以正常工作。

所以我想了解nginx中的人体尺寸到底是什么。是整个数据包还是整个数据包的一小部分/较小部分(例如,如上所述,我要推送2GB)。

任何帮助将不胜感激。

解决方法

您必须在请求正文中设置允许的最大大小。因此,您必须将值设置为大于要推送的数据大小。

从文档中 https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md#custom-max-body-size

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

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...