标签:local server tls vhost read 本机 监控 accept 状态
1、检查NGINX是否安装了状态模块[root@localhost nginx-1.6.3]# ./sbin/nginx -V #--with-http_stub_status_module
nginx version: nginx/1.6.3
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC)
TLS SNI support enabled
configure arguments: --user=www --group=www --with-http_ssl_module --prefix=/app/nginx-1.6.3 --with-http_stub_status_module
[root@localhost nginx-1.6.3]# vi conf/vhost/default.conf
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
location /nginx_status { #nginx状态监控URL访问地址
stub_status on; #启动状态监控
access_log off; #关闭状态模块的日志功能,不影响正常日志
allow 127.0.0.1; #只允许本机访问
deny all; #拒绝所有
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
[root@localhost nginx-1.6.3]# curl http://127.0.0.1/nginx_status
Active connections: 1
server accepts handled requests
2 2 2
Reading: 0 Writing: 1 Waiting: 0
标签:local server tls vhost read 本机 监控 accept 状态
原文地址:http://blog.51cto.com/12965094/2144980