-
为nginx增加统计模块
image.png
location /NginxStatus {
stub_status on;
access_log off;
# auth_basic "NginxStatus";
# auth_basic_user_file conf/htpasswd;
}
-
./nginx -s reload 报错nginx: [emerg] unknown directive "stub_status" in /usr/local/nginx/conf/nginx.conf:54 说明编译安装时没有加--with-http_stub_status_module
./nginx -V
./configure --with-http_ssl_module --with-http_v2_module --with-stream --with-http_stub_status_module
make
cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak (备份nginx)
cp ./objs/nginx /usr/local/nginx/sbin/ -
重新加载nginx配置文件 ./nginx -s reload
http://xx.xx.xx.xx/NginxStatus - 这样就能看到nginx的状态了
网友评论