zoukankan      html  css  js  c++  java
  • Nginx中ngx_http_auth_basic_moudel和ngx_http_stub_status_module模块

    ngx_http_auth_basic_module
    实现基于⽤用户的访问控制,使⽤用basic机制进⾏行行⽤用户认证
    指令:
    5.1 auth_basic
    Syntax: auth_basic string | off;
    Default: auth_basic off;
    Context: http, server, location,
    limit_except
    5.2 auth_basic_user_file
    Syntax: auth_basic_user_file file;
    Default: —
    Context: http, server, location,
    limit_except
    location /images/ {
    root /app/web/;
    auth_basic "Admin Area";
    auth_basic_user_file /etc/ng
    inx/.ngxpasswd;
    }
    5.2.1 ⽤用户⼝口令⽂文件
    1、明⽂文⽂文本:格
    式 name:password:comment
    2、加密⽂文本:由 htpasswd 命令实现,安装
    包是 httpd-tools
    htpasswd -cm /etc/nginx/.ngxpasswd a
    dmin
    六、ngx_http_stub_status_modul
    e
    ⽤用于输出nginx的基本状态信息
    Syntax: stub_status;
    Default: —
    Context: server, location
    location /status/ {
    stub_status;
    }
    提供⼀一下状态信息
    Active connections # 当前状态,活动状
    态的连接数
    accepts # 统计总值,已经接受的客户端请
    求的总数
    handled # 统计总值,已经处理理完成的客户
    端请求的总数
    requests # 统计总值,客户端发来的总的请
    求数
    Reading # 当前状态,正在读取客户端请求
    报⽂文⾸首部的连接的连接数
    Writing # 当前状态,正在向客户端发送响
    应报⽂文过程中的连接数
    Waiting # 当前状态,正在等待客户端发出
    请求的空闲连接数

  • 相关阅读:
    sqlserver 自学笔记 函数实训 学分学期转换函数的设计
    jquery dom操作
    jquery clone方法
    Go开发常见陷阱
    Go 语言从新手到大神:每个人都会踩的五十个坑(转)
    Go文件操作大全
    linux下安装go
    Go 学习笔记
    分布式系统设计系列 -- 基本原理及高可用策略 (转)
    安装Redis图形监控工具---RedisLive
  • 原文地址:https://www.cnblogs.com/momenglin/p/11024920.html
Copyright © 2011-2022 走看看