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

测评

内地特供的网游性价比神U!酷睿i7-13790F评测:游戏性能强于锐龙9 7950X

2023-9-14 0:06:50

4 条回复 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. "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!"

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