您好,登录后才能下订单哦!
密码登录
            
            
            
            
        登录注册
            
            
            
        点击 登录注册 即表示同意《亿速云用户服务条款》
        在企业网站中,为了避免同一个客户长时间占用连接,造成资源浪费,可设置相应的连接超时参数,实现控制连接访问时间。
[root@localhost nginx]# curl -I 192.168.52.131
HTTP/1.1 200 OK
Server: nginx/1.1.1
Date: Wed, 13 Nov 2019 11:06:54 GMT
Content-Type: text/html
Content-Length: 637
Last-Modified: Wed, 13 Nov 2019 08:09:06 GMT
Connection: keep-alive   //无超时时间
ETag: "5dcbba22-27d"
Accept-Ranges: bytes[root@localhost nginx]# vim conf/nginx.conf
    keepalive_timeout  65 180;  //连接保持超时时间,65为服务端超时时间,180为客户端超时时间,单位秒
    client_header_timeout 80;   //等待客户端发送请求头部的超时时间
    client_body_timeout 80;   //请求体读超时时间
[root@localhost nginx]# service nginx restart    //重启服务
[root@localhost nginx]# [root@localhost nginx]# curl -I 192.168.52.131
HTTP/1.1 200 OK
Server: nginx/1.1.1
Date: Wed, 13 Nov 2019 11:08:28 GMT
Content-Type: text/html
Content-Length: 637
Last-Modified: Wed, 13 Nov 2019 08:09:06 GMT
Connection: keep-alive
Keep-Alive: timeout=180   //超时时间
ETag: "5dcbba22-27d"
Accept-Ranges: bytes
[root@localhost nginx]#免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。