

[root@web01 ~]# yum install -y nginx
[root@web01 ~]# vim /etc/nginx/nginx.conf ..... include /etc/nginx/default.d/*.conf; location / { } location /nginx_status { stub_status; } error_page 404 /404.html; location = /404.html { } ... [root@web01 ~]#
[root@web01 ~]# systemctl start nginx.service [root@web01 ~]# systemctl enable nginx.service
http://10.0.0.7/nginx_status
Active connections(活动连接数): 2 server accepts(接受的) handled(已处理) requests(接收到的请求) 2 2 2 Reading: 0 Writing: 1 Waiting: 1
[root@web01 ~]# curl http://127.0.0.1/nginx_status
[root@web01 ~]# curl http://127.0.0.1/nginx_status 2>/dev/null|awk 'NR==1{print $NF}' 。。。