location/nginx-status{stub_status on;access_log off;# auth_basic "NginxStatus";# auth_basic_user_file /usr/local/nginx-1.6/htpasswd;allow192.168.10.100;allow172.29.73.0/24;deny all;} 我们也常用 httpd-devel 工具的 htpasswd 来为访问的路径设置登录密码: # htpasswd -c htpasswd adminNewpasswd:Re...
打开http_stub_status_module模块之后,还需要修改 Nginx 配置文件,在默认主机里面加上 location 或者你希望能访问到的主机里面加上如下配置: 代码语言:javascript 代码运行次数:0 复制 Cloud Studio代码运行 location/status{stub_status on;access_log off;allow127.0.0.1;deny all;#auth_basic"NginxStatus";#auth_b...
location /basic_status { stub_status; } 1. 2. 3.结果: curl http://192.168.31.200/basic_status Active connections: 1 server accepts handled requests 24 24 24 Reading: 0 Writing: 1 Waiting: 0 Active connections:当前状态,活动状态的连接数 accepts:统计总值,已经接受的客户端请求的总数 handled:统...
location /status{stub_status on;allow172.16.61.4;#我们只将该页面限制在本地ip地址可以访问deny all;} 1. 2. 3. 4. 5. **ngx_http_auth_basic_module模块的配置(basic认证)** auth_basic string|off;使用http basic认证协议对用户进行认证; auth_basic_user_file file;实现用户的账帐号文件; [root@no...
auth_basic_user_file ../htpasswd; } stub_status设置为“on”表示启用StubStatus的工作状态统计功能。access_log 用来指定StubStatus模块的访问日志文件。auth_basic是Nginx的一种认证机制。auth_basic_user_file用来指定认证的密码文件,由于Nginx的auth_basic认证采用的是与Apache兼容的密码文件,因此需要用Apache的htpa...
location/status{stub_status on;# 表示开启stubStatus的工作状态统计功能。 access_log off;# access_log off;关闭access_log 日志记录功能。 #auth_basic"status";# auth_basic 是nginx的一种认证机制。 #auth_basic_user_file conf/htpasswd;# 用来指定密码文件的位置。} ...
location/nginx-status{stub_status on;access_log off;# auth_basic "NginxStatus";# auth_basic_user_file /usr/local/nginx-1.6/htpasswd;allow192.168.10.100;allow172.29.73.0/24;deny all;} 我们也常用 httpd-devel 工具的 htpasswd 来为访问的路径设置登录密码: ...
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 查看nginx状态location /NginxStatus {stub_status on;access_log on;auth_basic "NginxStatus";auth_basic_user_file conf/htpasswd; # 需要使用htpasswd生成密码文件}复制代码 deny all;禁止访问匹配中的location 返回反代配置...
location /status { stub_status on; #表示开启stubStatus的工作状态统计功能。 access_log off; #access_log off; 关闭access_log 日志记录功能。 #auth_basic "status"; #auth_basic 是nginx的一种认证机制。 #auth_basic_user_file conf/htpasswd; #用来指定密码文件的位置。
location/NginxStatus{stub_status on;access_log on;auth_basic"NginxStatus";auth_basic_user_file conf/htpasswd;}#禁止访问.htxxx 文件 location~/\.ht{deny all;}#错误处理页面(可选择性配置) #error_page404/404.html;#error_page500502503504/50x.html;#location=/50x.html{# root html;#}}} ...