nginx sets the length of server response time

Method 1. Pagoda deploys nginx to set the length of server response time

After setting, restart nginx
insert image description here

Method 2. config configuration

http {
    # ...
    
    # 设置连接超时时间为30秒
    fastcgi_connect_timeout 30s; 
        
    # 设置请求超时时间为60秒
    fastcgi_send_timeout 60s;
    fastcgi_read_timeout 60s;
    proxy_send_timeout 60s;
    proxy_read_timeout 60s;
    client_body_timeout 60s;
    client_header_timeout 60s;
    send_timeout 25;    
    # ...
}

(1) proxy_connect_timeout: the timeout period of the backend server connection_initiate handshake and wait for response timeout period

(2) proxy_read_timeout: Waiting for the response time of the back-end server after the connection is successful has actually entered the queue of the back-end waiting for processing

(3) proxy_send_timeout: Backend server data return time_ means that the backend server must send all the data within the specified time

(4) client_header_timeout: (default 60s) Specifies the timeout period for waiting for the client to send a request header (for example: GET / HTTP/1.1). Only when the request header is not received in a read, it will be counted as a timeout. If the client does not send anything within the timeout period, nginx returns HTTP status code 408 ("Request timed out")

(5) client_body_timeout: (default 60s) This command sets the read timeout of the request body. Only when the request body is not obtained in a readstep, it will be set to timeout. After timeout, nginx returns HTTP status code 408 ("Request timed out")

Guess you like

Origin blog.csdn.net/Ls66666Ls/article/details/130387577