In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces nginx how to deal with request body parameter configuration, the article is very detailed, has a certain reference value, interested friends must read it!
In general, nginx is connected to the client through a public network, while nginx is connected to the upstream service through a private network, and the private network bandwidth is much higher than that of the public network. The default for nginx to handle request body is to accept all the data before forwarding it to the upstream service.
Search for body in ngx_http_core_module with the following configuration:
Client_body_buffer_size:
Syntax: client_body_buffer_size size;Default: client_body_buffer_size 8k | 16kscape context: http, server, location
Sets the buffer size used to read the client request body. If the request body is larger than the buffer, the whole body or only part of it is written to a temporary file. By default, the buffer size is equal to two memory pages. On x86, other 32-bit platforms and x86-64, it is 8K. On other 64-bit platforms, it is usually 16K.
If the size of the request body is less than this value, only the required size is allocated. If it is greater than this value, the memory size defined here is requested and reused until the body is received.
The default value of nginx is used for Kong proxy client request, and the default admin api of KONG_CLIENT_BODY_BUFFER_SIZE=20m.Kong is 10m, which can be modified through environment variables.
It should be noted that, theoretically, this value is relatively small, but the increase in the number of times to read and write the hard disk will affect the upload speed and will not cause errors. However, a failed nginx Connection reset by peer upload error occurred in the log, which may be due to the slow upstream service processing process, which caused the front-end nginx to disconnect when it timed out.
Client_body_timeout
Syntax: client_body_timeout time;Default: client_body_timeout 60sbot context: http, server, location
Defines the timeout for reading the client request body. The timeout is set only for a period of time between two consecutive read operations, not for the transmission of the entire request body. If the client does not transmit anything within this time, the request is terminated with a 408 (request timeout) error.
Client_max_body_size
Syntax: client_max_body_size size;Default: client_max_body_size 1m political context: http, server, location
Sets the maximum allowable size of the client request body, specified in the "Content-Length" request header field. If the size in the request exceeds the configured value, a 413 (request entity is too large) error is returned to the client. Note that the browser does not display this error correctly. Setting size to 0 disables checking the principal size of the client request.
K8s ingress setting, add note: nginx.ingress.kubernetes.io/proxy-body-size: 100m.
The default value of Kong is 0, which means there is no limit.
Client_body_in_file_only
Client_body_in_single_buffer
Client_body_temp_path
These are all the contents of the article "how nginx handles request body parameter configuration". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.