--with-http_stub_status_module This module function is to record the Nginx basic information Access status
1, check whether the compilation has this function module.
[Root@slave nginx]#/usr/sbin/nginx-v
Nginx version:nginx/1.8.0
Built by GCC 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC)
Built with OpenSSL 1.0.1e-fips 2013
TLS SNI Support Enabled
Configure arguments:--prefix=/usr/local/nginx--sbin-path=/usr/sbin/nginx--conf-path=/etc/nginx/nginx.conf-- Error-log-path=/var/log/nginx/error.log--http-log-path=/var/log/nginx/access.log--pid-path=/var/run/nginx/ Nginx.pid--lock-path=/var/lock/nginx.lock--user=nginx--group=nginx--with-http_ssl_module--with-http_flv_module --with-http_realip_module--with-http_stub_status_module--with-http_gzip_static_module-- http-client-body-temp-path=/var/tmp/nginx/client/--http-proxy-temp-path=/var/tmp/nginx/proxy/-- http-fastcgi-temp-path=/var/tmp/nginx/fcgi/--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi--http-scgi-temp-path=/ var/tmp/nginx/scgi--with-pcre
[Root@slave nginx]#
2. Add the server segment under the directory
# #status
server {
Listen 80;
server_name status.wolf.com;
Location/{
Stub_status on;
Access_log off;
}
}
3. Add hosts
[Root@slave nginx]# vi/etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
:: 1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.203 www.wolf.com bbs.wolf.com blog.wolf.com wolf.com status.wolf.com
Notebook add
[Root@slave nginx]# vi/etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
:: 1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.203 www.wolf.com bbs.wolf.com blog.wolf.com wolf.com status.wolf.com
4. Grammar check
[Root@slave nginx]#/usr/sbin/nginx-t
Nginx:the configuration file/etc/nginx/nginx.conf syntax is OK
Nginx:configuration file/etc/nginx/nginx.conf Test is successful
5. Restart Service
[Root@slave nginx]#/usr/sbin/nginx-s Reload
6. Testing
Browser http://status.wolf.com/Access
Active Connections:5
Server accepts handled requests
54 54 408
reading:0 writing:1 Waiting:4
[Root@slave nginx]# Curl status.wolf.com
Active Connections:6
Server accepts handled requests
55 55 414
reading:0 writing:1 Waiting:5
7. Access Restrictions
# #status
server {
Listen 80;
server_name status.wolf.com;
Location/{
Stub_status on;
Access_log off;
Allow 192.168.0.0/24;
Deny all;
}
}
8. Access Log Description
Active connections– number of connected connections
A total of 11,989 connections were processed by the server accepts handled requests-, and 11,989 handshakes were successfully created, with a total of 11,991 requests processed
Reading-reads the number of connections to the client.
writing-number of response data to the client
waiting-The keep-alive is turned on, this value equals active– (reading+writing), meaning that Nginx has finished processing the host connection that is waiting for the next request instruction.
The above describes the Nginx information function is enabled, including the content, I hope that the PHP tutorial interested in a friend helpful.