In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces you how to achieve timeout timeout configuration in Nginx, the content is very detailed, interested friends can refer to, hope to be helpful to you.
Keepalive_timeout
HTTP has a KeepAlive mode that tells webserver to keep the TCP connection open after processing a request. If other requests are received from the client, the server will take advantage of the unclosed connection without the need to establish another connection.
Http keep-alive, every request of the network is HTTP (chip, CSS, etc.), but to open the HTTP request is to establish a TCP connection first, and if an TCP connection is opened and closed, it will become a wave of resources. Keepalive_timeout is the time left when a HTTP request is completed and its TCP connection is saved. If another HTTP request is received at this time, the TCP connection will be used. If there are no new requests, the TCP connection will be related.
User nginx;worker_processes 1; error_log / var/log/nginx/error.log warn;pid / var/run/nginx.pid; events {worker_connections 1024;} http {include / etc/nginx/mime.types; default_type application/octet-stream Log_format main'$remote_addr-$remote_user [$time_local] "$request"'$status $body_bytes_sent "$http_referer"'"$http_user_agent"$http_x_forwarded_for"; access_log / var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; client_max_body_size 8192 m; # gzip on # include / etc/nginx/conf.d/*.conf; server {listen 80 so_keepalive=30m::; listen 443 default ssl; ssl_certificate / etc/nginx/ssl/server.crt; ssl_certificate_key / etc/nginx/ssl/portalkey.key; # ssl_password_file / etc/nginx/ssl/ssl.pass; ssl_session_timeout 5m; ssl_protocols SSLv2 SSLv3 TLSv1; ssl_ciphers High Location / {proxy_request_buffering off; proxy_pass http://127.0.0.1:8011/; proxy_connect_timeout 180; proxy_send_timeout 180; proxy_read_timeout 180; send_timeout 180;} location / test1_url/ {proxy_pass http://127.0.0.1:8008/; proxy_connect_timeout 180; proxy_send_timeout 180; proxy_read_timeout 180; send_timeout 180 } location / test2_url/ {proxy_pass http://127.0.0.1:3000/; proxy_connect_timeout 180; proxy_send_timeout 180; proxy_read_timeout 180; send_timeout 180;}
# configuration segment: http, default is 75s
Keepalive_timeout 60
Send_timeout: timeout for sending data to the client. Default is 60s. If the client does not receive 1 byte within 60 consecutive seconds, the connection is closed.
Proxy_connect_timeout: the connection timeout between nginx and upstream server
Proxy_read_timeout: nginx timed out receiving upstream server data. Default is 60s. If no byte is received within 60 consecutive seconds, the connection is closed.
Proxy_send_timeout: nginx timed out sending data to upstream server. Default is 60s. If no byte is sent within 60 consecutive seconds, the connection is closed.
So_timeout:
The user has enabled TCP CONNECTION with SERVER-- > for a long time this CONNECTION does not have traffic (so_keepalive timeout)-- > SERVER sends a probe package to see if it still exists-- > if the probe package does not return, close TCP CONNECTION.
So_keepalive=on | off | [keepidle]: [keepintvl]: [keepcnt] so_keepalive=30m::10 will set the idle timeout (TCP_KEEPIDLE) to 30 minutes, leave the probe interval (TCP_KEEPINTVL) at its system default, and set the probes count (TCP_KEEPCNT) to 10 probes. On how to achieve timeout timeout configuration in Nginx to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.