zoukankan      html  css  js  c++  java
  • 记录Nginx模块开发

    • --with-http_stub_status_module模块:Nginx的客户端状态

                Syntax:stub_status

                Default:--

                Content:server,location

    location /mystatus{

       stub_status;

    }

    >>效果图

    • --with-http_random_index_module模块:目录中选择一个随机主页

                Syntax:random_index on|off

                Default:random_index off;

                Content:location

    location /{

       root  随机文件的文件夹;

       random_index on;

    }

    • --with-http_sub_module模块:http内容替换

                Syntax:sub_filter string replacement

                Default:--

                Content:http,server,location

    location /{

      sub_filter '被替换值' '替换值';

    }

    • --with-http_limit_conn_module模块:连接限制

                Syntax:limit_conn_zone key zone=name:size;

                Default:--

                Content:http

                Syntax:limit_conn [zone] number;

                Default:--

                Content:http,server,location

    limit_conn_zone $binary_remote_addr zone=conn_zone:1m;

    server{  

      location / {

               limit_conn conn_zone 1;

      }

    }

    • --with-http_limit_req_module模块:请求限制

                Syntax:limit_req_zone key zone=name:size rate=size;

                Default:--

                Content:http

                Syntax:limit_req zone=name [burst=number][nodelay];

                Default:--

                Content:http

    limit_req_zone $binary_remote_addr zone=req_zone:1m rate=1r/s;

    server{  

      location / {

               #limit_req zone=req_zone;

               #limit_req zone=req_zone burst=3;

               #limit_req zone=req_zone burst=3 nodelay;
    }
    • --with-http_access_module模块:访问控制-基于IP的访问控制

                Syntax:allow address | CIDR | unix: |all;

                Default:--

                Content:http,server,location,limit_except;

                Syntax:deny address | CIDR | unix: |all;

                Default:--

                Content:http,server,location,limit_except;

    server{  

      location / {

               root   /usr/share/nginx/html;

               index  index.html index.htm;

           }

           location ~^ / 50x.html {

               root   /usr/share/nginx/html;

               #allow 117.30.57.5;

               #allow 117.30.57.5/40;#允许5-40IP地址段访问

               deny all;

           }

    }
    • --with-http_auth_basic_module模块:访问控制-基于用户的信任登陆

                Syntax:auth_basic string|off;

                Default:auth_basic off;

                Content:http,server,location,limit_except

                Syntax:auth_basic_user_file file;

                Default:--

                Content:http,server,location,limit_except


  • 相关阅读:
    WinForm换行
    aspx获取页面间传送的值
    Response.BinaryWrite()方法输出二进制图像
    Jquery删除table的行和列
    WinForm DataGridView控件隔行变色
    IE中table的innerHTML无法赋值
    C#为IE添加可信任站点
    静态代码检查
    第三方开源小工具
    查看sql server 服务器内存使用情况
  • 原文地址:https://www.cnblogs.com/chenbingquan/p/10711466.html
Copyright © 2011-2022 走看看