nginx如何添加http_stub_status_module模块(nginx,开发技术)

时间:2024-05-09 08:38:42 作者 : 石家庄SEO 分类 : 开发技术
  • TAG :

1. stub_status 作用说明

编译选项作用–with-http_stub_status_moduleNginx的客户端状态

2.查看现有 nginx 编译参数

./nginx-V#如果没有我们需要的模块,例如本次试验添加的–with-http_stub_status_module,那么则需要重新编译安装一下

nginx如何添加http_stub_status_module模块

3.使用参数重新配置configure,在原有基础上添加上 --with-http_stub_status_module

configure 文件是在安装包目录下的文件,具体可参考 centos 7 安装 nginx

./configure--prefix=/usr/local/nginx--with-http_realip_module--with-http_ssl_module--with-pcre--with-stream--with-http_stub_status_module

4.将原来的 nginx 文件备份

cp/usr/local/nginx/sbin/nginx/usr/local/nginx/sbin/nginx.bak

5. 编译

make#这里是需要make编译,不用makeinstall

6. 替换nginx二进制文件

#找到nginx安装包目录/root/nginx-1.10.1/objs,将nginx文件复制到原本的/usr/local/nginx/sbin/nginxcp/root/nginx-1.10.1/objs/nginx/usr/local/nginx/sbin/

nginx如何添加http_stub_status_module模块

7.重新启动nginx,查看编译参数

./nginx-sreload./nginx-V

8. 参考官网

8.1 修改配置文件

文件目录:/usr/local/nginx/conf

nginx如何添加http_stub_status_module模块

#在文件中添加新的locationlocation/nginx_status{ stub_status;}#解释说明: nginx_status 这是自定义命名的,访问的时候添加这个字段访问 stub_status; 这个是固定参数

nginx如何添加http_stub_status_module模块

8.2 浏览器访问

http://192.168.169.131/nginx_status#访问内容结果如下图

nginx如何添加http_stub_status_module模块

#解释说明:1)Activeconnections-活跃连接数ThecurrentnumberofactiveclientconnectionsincludingWaitingconnections.(2)accepts-已接受的客户端连接总数Thetotalnumberofacceptedclientconnections.(3)handled-已处理的连接总数Thetotalnumberofhandledconnections.Generally,theparametervalueisthesameasacceptsunlesssomeresourcelimitshavebeenreached(forexample,theworker_connectionslimit).(4)requests-客户端连接总数Thetotalnumberofclientrequests.(5)Reading-读取请求头的当前连接数Thecurrentnumberofconnectionswherenginxisreadingtherequestheader.(6)Writing-将响应写回客户端的当前连接数Thecurrentnumberofconnectionswherenginxiswritingtheresponsebacktotheclient.(7)Waiting-等待请求的当前空闲客户端连接数Thecurrentnumberofidleclientconnectionswaitingforarequest.
 </div> <div class="zixun-tj-product adv-bottom"></div> </div> </div> <div class="prve-next-news">
本文:nginx如何添加http_stub_status_module模块的详细内容,希望对您有所帮助,信息来源于网络。
上一篇:Python区块链交易类怎么创建下一篇:

13 人围观 / 0 条评论 ↓快速评论↓

(必须)

(必须,保密)

阿狸1 阿狸2 阿狸3 阿狸4 阿狸5 阿狸6 阿狸7 阿狸8 阿狸9 阿狸10 阿狸11 阿狸12 阿狸13 阿狸14 阿狸15 阿狸16 阿狸17 阿狸18