Nginx reverse proxy prompt 413 Request Entity Too Large

 The content returned by the request is as follows

<html>
<head><title>413 Request Entity Too Large</title></head>
<body>
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx/1.20.2</center>
</body>
</html>

Judging from the prompt information, the reason is that the request body is too large. The client_max_body_size attribute in Nginx is used to configure the maximum value of the client request body. This attribute can be configured under the http node (http global), the server node (server global), or the location node ( single application). It should be noted that the default value of this attribute is 1m, which limits the size of the request entity to 1m.

Under http node:

http {
    # 将Nginx代理的所有请求实体的大小限制为10m
    client_max_body_size 10m;
}

Under the server node:

server {
    # 将该服务下的所有请求实体的大小限制为10m
    client_max_body_size 10m;
}

 Under the location node:

location / {
    # 将此路由请求的实体大小限制为10m
    client_max_body_size 10m;
}

Restart the Nginx service after configuration

Guess you like

Origin blog.csdn.net/caicaimaomao/article/details/131550060