1. Nginx status information function
The status module records the basic access status information of nginx, allowing users to understand the working status of Nginx
When compiling Nginx, the --with-http_stub_status_module module must be added to support
# nginx/sbin/nginx -V
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=nginx --group=nginx --prefix=/usr/local/nginx-1.6.3/ --with-http_stub_status_module --with-http_ssl_module
Configure Nginx status status information display
Add in the corresponding virtual host
# vim nginx/conf/extra/www123.conf
server {
listen 80;
server_name www.123.org 123.org;
location / {
root html/www;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
#### status zhuangtaixinxi #####
location /nginx_status {
stub_status on;
access_log off;
allow 192.168.230.0/23;
deny all;
}
}
# nginx/sbin/nginx -t
# nginx/sbin/nginx -s reload
Browser access test http://www.123.org/nginx_status
Detailed explanation of display results
Active connections: 1 #Indicates that there are 1 active connections being processed by Nginx
server accepts handled requests
191952
Reading: 0 Writing: 1 Waiting: 0
The first server 19 indicates that Nginx has processed a total of 19 connections so far
The second one indicates that server 19 indicates that Nginx has successfully created 19 handshakes since it was started.
Number of requests lost = (number of handshakes - number of connections), it can be seen that this status shows that there are no lost requests
The third handled requests 52 indicates that a total of 52 requests were processed
Reading is the number of Header information read by Nginx to the client
Writing is the number of writing information returned by Nginx to the client
Waiting is the resident connection that Nginx has processed and is waiting for the next request command. When keep-alive is turned on, this value is equal to active—(reading+writing)