Nginx服务优化(五)设置连接超时
发表于:2024-09-23 作者:千家信息网编辑
千家信息网最后更新 2024年09月23日,配置Nginx实现连接超时在企业网站中,为了避免同一个客户长时间占用连接,造成资源浪费,可设置相应的连接超时参数,实现控制连接访问时间。1.用"curl -I"命令查看connection参数[roo
千家信息网最后更新 2024年09月23日Nginx服务优化(五)设置连接超时
配置Nginx实现连接超时
在企业网站中,为了避免同一个客户长时间占用连接,造成资源浪费,可设置相应的连接超时参数,实现控制连接访问时间。
1.用"curl -I"命令查看connection参数
[root@localhost nginx]# curl -I 192.168.52.131HTTP/1.1 200 OKServer: nginx/1.1.1Date: Wed, 13 Nov 2019 11:06:54 GMTContent-Type: text/htmlContent-Length: 637Last-Modified: Wed, 13 Nov 2019 08:09:06 GMTConnection: keep-alive //无超时时间ETag: "5dcbba22-27d"Accept-Ranges: bytes
2.修改nginx配置文件
[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]#
3.再次用"curl -I"命令查看connection参数
[root@localhost nginx]# curl -I 192.168.52.131HTTP/1.1 200 OKServer: nginx/1.1.1Date: Wed, 13 Nov 2019 11:08:28 GMTContent-Type: text/htmlContent-Length: 637Last-Modified: Wed, 13 Nov 2019 08:09:06 GMTConnection: keep-aliveKeep-Alive: timeout=180 //超时时间ETag: "5dcbba22-27d"Accept-Ranges: bytes[root@localhost nginx]#
时间
参数
客户
服务
命令
客户端
配置
企业
企业网站
再次
单位
头部
文件
网站
资源
可设
长时
控制
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
部队网络安全成语
服务器 水冷
网络安全宣传周发布会
cdgo韩国服务器
数据库索引的重构过程
网络安全领域投资
网络安全十条禁令壁纸
可以根据数据库写软件吗
老师网络安全倡议书百度文库
教育技术学计算机网络技术
安徽数据库空投箱价目表
给服务器打补丁会导致系统崩溃吗
著名软件开发公司排名
it软件开发职位规划
镇江企业软件开发管理
学习网络技术的前提是啥
关于公司网络安全方案
聚客互联网科技有限公司
计算机网络技术好学吗前景好吗
山东工厂库存软件开发
启明软件开发有限公司
什么叫非关系型数据库
vpn服务器nat转发
医药软件开发策划书
分宜租房网络安全
数据库建表 性别
华硕服务器主板怎么关闭网卡启动
北京大数据软件开发哪家正规
DNS服务器的层次
网络技术员前景