首页 > 其他 > 详细

监控nginx运行状态

时间:2016-01-20 06:33:32      阅读:212      评论:0      收藏:0      [点我收藏+]

使用http_stub_status_module

在编译安装nginx的时候可以加上--with-http_stub_status_module,如果已经安装好nginx可以参考nginx安装完成后增加模块的博文,

nginx.confserver块中添加如下代码

location /status {

    # Turn on nginxstats

    stub_status on;

    # I do not needlogs for stats

    access_log   off;

    # Security:Only allow access from 192.168.1.100 IP #

    #allow192.168.1.100;

    # Send rest ofthe world to /dev/null #

    #deny all;

}

重启nginx即可通过ip:端口/status就可以查看到了类似下面的页面

Active connections: 3 
server accepts handled requests
 10 10 137 
Reading: 0 Writing: 1 Waiting: 2




监控nginx运行状态

原文:http://zhaol.blog.51cto.com/4185340/1736530

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!