一、Nginx 服务器开启status页面检测服务状态
Nginx可以通过with-http_stub_status_module模块来监控Nginx服务器的状态信息。
1、通过nginx -V来查看是否有with-http_stub_status_module该模块。
文章源自小柒网-https://www.yangxingzhen.cn/5051.html
[root@localhost ~]# /usr/local/nginx/sbin/nginx -V文章源自小柒网-https://www.yangxingzhen.cn/5051.html
文章源自小柒网-https://www.yangxingzhen.cn/5051.html
PS:nginx -V 这里"V"是大写的,如果是小写的v 即"nginx -v",则不会出现有哪些模块,只会出现nginx的版本。文章源自小柒网-https://www.yangxingzhen.cn/5051.html
文章源自小柒网-https://www.yangxingzhen.cn/5051.html
2、修改Nginx.conf配置文件,添加以下内容:
文章源自小柒网-https://www.yangxingzhen.cn/5051.html
[root@localhost ~]# vim /usr/local/nginx/conf/nginx.conf
文章源自小柒网-https://www.yangxingzhen.cn/5051.html
location ~ /nginx_status {
stub_status on;
access_log off;
allow all;
}
#保存退出。文章源自小柒网-https://www.yangxingzhen.cn/5051.html
3、重启Nginx服务文章源自小柒网-https://www.yangxingzhen.cn/5051.html
[root@localhost ~]# /usr/local/nginx/sbin/nginx -s reload文章源自小柒网-https://www.yangxingzhen.cn/5051.html
4、访问nginx_status状态页
#浏览器访问http://192.168.0.99/nginx_status
Active connections: 2 表示Nginx正在处理的活动连接数2个。
server 9 表示Nginx启动到现在共处理了9个连接
accepts 9 表示Nginx启动到现在共成功创建9次握手
handled requests 10 表示总共处理了10次请求
Reading:0 读取到客户端的 Header 信息数
Writing:1 返回给客户端 Header 信息数
Waiting:0 已经处理完正在等候下一次请求指令的驻留链接(开启keep-alive的情况下,这个值等于Active-(Reading+Writing))
若文章图片、下载链接等信息出错,请在评论区留言反馈,博主将第一时间更新!如本文“对您有用”,欢迎随意打赏,谢谢!


写的不错