一、Nginx启用Status状态页面
Nginx可以通过with-http_stub_status_module模块来监控Nginx服务器的状态信息。
1、通过nginx -V来查看是否有with-http_stub_status_module该模块。
[root@localhost ~]# /usr/local/nginx/sbin/nginx -V
PS:nginx -V 这里"V"是大写的,如果是小写的v 即"nginx -v",则不会出现有哪些模块,只会出现nginx的版本。
2、修改Nginx.conf配置文件,添加以下内容:
[root@localhost ~]# vim /usr/local/nginx/conf/nginx.conf
location ~ /nginx_status {
stub_status on;
access_log off;
allow all;
}
#保存退出。
3、重启Nginx服务
[root@localhost ~]# /usr/local/nginx/sbin/nginx -s reload
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))
Great post! I found your insights really enlightening. I'm curious, what inspired you to start writing about this subject? Also, do you have any recommendations for further reading or resources on this topic? Looking forward to your response!
Great post! I found your insights really enlightening. I'm curious, what inspired you to start writing about this subject? Also, do you have any recommendations for further reading or resources on this topic? Looking forward to your response!
Great post! I found your insights really enlightening. I'm curious, what inspired you to start writing about this subject? Also, do you have any recommendations for further reading or resources on this topic? Looking forward to your response!
"Your thoughtful insights into business evolution are remarkable! Through ExplodingBrands, Germany's premier directory at explodingbrands.de, we've observed similar patterns across our diverse categories. Our platform's comprehensive coverage of marketing, home services, and professional sectors provides unique market perspectives. As Deutschland's trusted business resource, we particularly value your analysis. Fantastic contribution!"