修改nginx配置文件,在http下添加server。
点击(此处)折叠或打开
- # vim /usr/local/nginx/conf/nginx.conf
点击(此处)折叠或打开
-
server {
-
listen 80;
-
server_name localhost www.abc.com;
-
location ~ ^/NginxStatus {
-
stub_status on;
-
access_log on;
-
allow all;
- }
点击(此处)折叠或打开
- # /usr/local/nginx/sbin/nginx -s reload
点击(此处)折叠或打开
- # curl http://localhost/NginxStatus
-
Active connections: 16418
server accepts handled requests
10154446441 10154446441 15444288409
Reading: 1 Writing: 201 Waiting: 16216
nginx status解释:
Active connections: 16418 #当前活跃的连接数量
server accepts handled requests
10154446441 10154446441 15444288409 #处理连接总和:10154446441,一共握手10154446441次,15444288409次请求。
Reading: 1 Writing: 201 Waiting: 16216 #读取客户端的连接1个,响应客户端的连接数据201个,由于开启了keep-alive,值是16418-reading-writing,大意是处理完成等候下一次请求的驻留连接数。
server accepts handled requests
10154446441 10154446441 15444288409 #处理连接总和:10154446441,一共握手10154446441次,15444288409次请求。
Reading: 1 Writing: 201 Waiting: 16216 #读取客户端的连接1个,响应客户端的连接数据201个,由于开启了keep-alive,值是16418-reading-writing,大意是处理完成等候下一次请求的驻留连接数。