Nginx four instructions associated with the network configuration

# keepalive_timeout

This command is used to set the timeout time holder Nginx server connected to the client. There are two instruction content, a specified timeout client connection remains active, the other option is, refers to the use Keep-Alive message header remains valid time of the event, if not provided Nginx does not send the client to the Keep-Alive message header in order to maintain some browsers (Mozilla, Konqueror, etc.) is connected with the client. Set of two values ​​based on the actual situation may be recommended to consider views from the server, processing speed, network status aspects:
keepalive_timeout	60 50;

This setting indicates the time Nginx server connected with the client keepalive is 60s, 60s server disconnects the connection with the client; Keep-Alive message using the header remains some browsers and client connection time of 50s, 50s after automatic browsing brake disconnects from the server.

# send_timeput

This command is used to set Nginx server response timeout period of the client, the timeout period after the establishment of the connection between, an event only for the client and the server, if after this time client does not have any activity, Nginx server will close the connection this directive is set to consider terms of the number of server access and network conditions such as:
send_timeout	10s;

This provided a rear Nginx server and client connection, a session, the server waits for a client response time exceeds 10s automatically disconnected.

# client_header_buffer_size

This command allows setting Nginx server requests the client buffer size of the head, the default 1KB. This instruction may be set assignment system according to the page size, page size may be obtained by "getconf PAGESIZE".

Nginx server had work experience friends may have encountered Nginx server returns a 400 error, it is difficult to find the reason. This error will not always occur when an error occurs, usually in the browser and logs do not see any relevant message, according to the actual situation, the situation is a large part of the client's request header is too large, request header too large client cookie is generally written in the large value caused. Therefore appropriate to increase the value of client_header_buffer_size can improve server supports the ability for clients:

client_header_buffer_size	4K;

#multi_accept

This instruction is configured to accept as many Nginx server network connection request from the client, the default is off. The closed state, each worker process can only receive a new network connection arrives
multi_accept	off;

Content Source: "Nginx high-performance web server explanation"

Guess you like

Origin blog.csdn.net/Linux_liuge/article/details/94896648