[root@localhost nginx-1.18.0]# ./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-debug --with-http_ssl_module --with-http_realip_module --with-http_image_filter_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_stub_status_module --...
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...
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...
# 设定查看 Nginx 状态地址 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;# 用来指定密码文件的位置。} 8.2 配置...
location /NginxStatus { stub_status on; access_log on; auth_basic "NginxStatus"; #auth_basic_user_file conf/htpasswd; } 配置完成重启Nginx,命令:/usr/local/nginx/nginx -s reload 10、状态查看 配置完成后在浏览器中输入http://192.168.0.194/NginxStatus查看,显示信息如下: ...
#auth_basic "status"; #auth_basic 是nginx的一种认证机制。 #auth_basic_user_file conf/htpasswd; #用来指定密码文件的位置。 } (2)配置登录密码: yum install -y httpd-tools /usr/local/apache/bin/htpasswd -c /data/nginx/conf/htpasswd biglittleant New password: 完成后会在/data/nginx/conf...
location / { auth_basic "admin passwd"; auth_basic_user_file passwd/.htpasswd; } 1. 2. 3. 4.3、ngx_http_stub_status_module模块 用于输出nginx的基本状态信息; 直接在配置文件中添加 location /basic_status { stub_status; } 1. 2. 3.结果...
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认证协议对用户进行认证;
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;#}}} ...
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 返回反代配置...