nginx thirteenth day

Nginx configuration state

Nginx有内置一个状态页,需要在编译的时候指定参数--with-http_stub_status_module参数方可打开。
也就是说,该功能是由http_stub_status_module模块提供,默认没有加载。
Nginx Configuration File
server{
	listen 80;
	server_name www.aminglinux.com;
	
	location /status/ {
	    stub_status on;
	    access_log off;
	    allow 127.0.0.1; allow 192.168.10.0/24; deny all; } }
Configuration instructions
  • location / status / when such access / status / status page to access the content.
  • stub_status on the status page opens.
  • access_log off without logging
  • allow and deny allowing only specified IP and IP segment access, because this page need to be protected, not public, of course, can do user authentication.
And test results show
测试命令:curl -x127.0.0.1:80 www.aminglinux.com/status/

结果如下:
Active connections: 1 
server accepts handled requests
 11 11 11 
Reading: 0 Writing: 1 Waiting: 0 说明: active connections – 活跃的连接数量 server accepts handled requests — 总共处理的连接数、成功创建的握手次数、总共处理的请求次数 需要注意,一个连接可以有多次请求。 reading — 读取客户端的连接数. writing — 响应数据到客户端的数量 waiting — 开启 keep-alive 的情况下,这个值等于 active – (reading+writing), 意思就是 Nginx 已经处理完正在等候下一次请求指令的驻留连接.

Guess you like

Origin www.cnblogs.com/jessi-w/p/12075015.html