Nginx启用Status状态页面

一、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

Nginx启用Status状态页面

PS:nginx -V 这里"V"是大写的,如果是小写的v 即"nginx -v",则不会出现有哪些模块,只会出现nginx的版本。

Nginx启用Status状态页面

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

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))

给TA打赏
共{{data.count}}人
人已打赏
运维

Linux搭建SVN服务器

2023-11-21 16:27:40

软件

Affinity Photo(图像编辑软件) v2.6.0.3134 多语便携版

2025-4-7 15:44:26

6 条回复 A文章作者 M管理员
  1. 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!

  2. 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!

  3. 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!

  4. Hello! I just finished reading your article, and I wanted to let you know how insightful it was! You’ve covered some very important points that often get overlooked, and I appreciated the way you presented everything. It was relatable, and I think many readers will find it helpful as well. I’ve been working on a similar topic on my website, where I dive into [mention relevant subject]. I’d love to hear your thoughts on it! Thanks again for sharing such valuable content. Keep up the awesome work!

  5. Hello! I just went through your article, and I have to say it was incredibly insightful! You’ve brought attention to some crucial points that often don’t get enough recognition, and I appreciated how clearly you laid everything out. It really resonated with me, and I believe many others will find it useful too. I’ve been discussing something similar on my website, where I cover [mention relevant subject]. It would be great to hear your thoughts on it! Thanks for sharing such valuable information. Keep up the excellent work!

  6. "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!"

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索