nginx配置状态模块报错

[root@web02 nginx-1.6.3]# /application/nginx/sbin/nginx  -t

nginx: [emerg] invalid number of arguments in "stub_status" directive in /application/nginx-1.6.3/conf/extra/status.conf:4
nginx: configuration file /application/nginx-1.6.3/conf/nginx.conf test faile

检查 /application/nginx/sbin/nginx -V

nginx version: nginx/1.6.3
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC)
TLS SNI support enabled
configure arguments: --prefix=/application/nginx-1.6.3 --user=www --group=www --with-http_stub_status_module --with-http_ssl_module

如果没有 --with-http_stub_status_module 模块 需要安装
在对应目录下执行编译安装三部曲
./configure –with-http_stub_status_module
make && make install

[root@web02 extra]# cat www.conf
server {
listen 80;
server_name 对应的域名;
location / {
root html/www;
index index.html index.htm;
}
#这个就是要需要开启的监控模块
#注意要在指定的server标签下加入 就是监控哪个域名
location /nginx_status {
stub_status on;
access_log off;
#加入访问限制

allow IP地址;

allow IP地址;

deny all

      }
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }
}

    然后平滑重启 

    [root@web02 extra]# /application/nginx/sbin/nginx  -s reload

在网址输入对应的域名
域名/nginx_status
Active connections: 2
server accepts handled requests
74 74 111
Reading: 0 Writing: 1 Waiting: 1

Active connections: 对后端发起的活动连接数.
Server accepts handled requests: Nginx总共处理了74个连接,成功创建74次握手(证明中间没有失败的),总共处理了111个请求.
Reading: Nginx 读取到客户端的Header信息数.
Writing: Nginx 返回给客户端的Header信息数.
Waiting: 开启keep-alive的情况下,这个值等于 active – (reading + writing),意思就是Nginx已经处理完成,正在等候下一次请求指令的驻留连接。

转载于:https://blog.51cto.com/13754503/2161438

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值