作者:鹰击长空1943 | 来源:互联网 | 2014-05-28 09:40
nginxstatus状态查看设置在配置文件/usr/local/server/nginx/conf/nginx.conf中添加#设定查看Nginx状态的地址,添加如下location/NginxStatus{stub_statuson;access_logon;auth_basicNginxStatus;auth_b
nginx status状态查看设置
在配置文件 /usr/local/server/nginx/conf/nginx.conf中添加
#设定查看Nginx状态的地址,添加如下
location /NginxStatus {
stub_status
on;
access_log
on;
auth_basic
"NginxStatus";
auth_basic_user_file
conf/htpasswd;
}
其中密码文件中每条用户名和密码的格式为: user:password
该密码文件不能由用户直接指定,需要通过apache的btpasswd生成密码
生成密码的指令为:
/usr/local/apache2/htpasswd -bc
/export/servers/nginx/conf/htpasswd usr1 passwd1
输入地址 http://10.0.0.1/NginxStatus/,输入验证帐号密码,即可
==============================================
无密码,限访问IP
location /nginx_status {
stub_status on;
access_log off;
allow SOME.IP.ADD.RESS; #例:allow
10.0.0.1/24
deny all;
}