j9九游会登录/ 应用平台 appstage/ / / / / slb实例配置
更新时间:2025-05-21 gmt 08:00

slb实例配置-j9九游会登录

本章介绍通过iac进行slb实例配置的管理,包括nginx.conf,url重写/重定向,内网段,降级,黑白名单,流控,其他配置以及自定义lua配置,对应的资源类型为wisecloud::loadbalancer::slb::config。

slb实例配置

表1 slb实例配置字段说明

参数名

是否必选

说明

instancename

是

slb实例名,长度<=50

globalconf

是

nginx配置,长度<=16777215

urlresetconf

否

url重写重定向

innersegmentsconf

是

内网段配置

degradeconf

否

降级配置

blacklistconf

否

黑名单配置

viplistconf

否

白名单配置

flowcontrolconf

否

流控配置

confluaconf

否

其他配置,不填采用默认值

customluaconf

否

自定义lua配置,每个lua文件大小不得超过16kb。

样例:

- name: fgc-slb-config                             #必传,slb配置实例名
  type: wisecloud::loadbalancer::slb::config       #资源类型为实例配置
  properties:
    instancename: fgc-slb                          #必传,slb实例名
    globalconf:                                    #必传,nginx配置
      $ref: 'slb_instance_config/nginx.conf'
    urlresetconf:                                  #非必传,url重写重定向配置
      $ref: 'slb_instance_config/url_reset_config.yaml#'
    innersegmentsconf:                             #必传,内网段配置
      $ref: 'slb_instance_config/inner_segments_config.yaml#'
    degradeconf:                                   #非必传,降级配置
      $ref: 'slb_instance_config/degrade_config.yaml#'
    blacklistconf:                                 #非必传,黑名单配置
      $ref: 'slb_instance_config/blacklist_config.yaml#'
    viplistconf:                                   #非必传,白名单配置
      $ref: 'slb_instance_config/viplist_config.yaml#'
    flowcontrolconf:                               #非必传,流控配置
      $ref: 'slb_instance_config/flow_control_config.yaml#'
    confluaconf:                                   #非必传,其他配置
      $ref: 'slb_instance_config/conf_lua_config.yaml#'
    customluaconf:                                 #非必传,自定义lua配置
      slb100globalinit: 
        $ref: 'slb_instance_config/slb_100_global_init_iac3.lua'
      slb200workerinit:
        $ref: 'slb_instance_config/slb_200_worker_init_iac3.lua'
      slb300preflowcontrol:
        $ref: 'slb_instance_config/slb_300_pre_flowcontrol_iac3.lua'
      slb400onflowcontroled:
        $ref: 'slb_instance_config/slb_400_on_flowcontroled_iac3.lua'
      slb500pregrey:
        $ref: 'slb_instance_config/slb_500_pre_grey_iac3.lua'
      slb600postgrey:
        $ref: 'slb_instance_config/slb_600_post_grey_iac3.lua'
      slb700postroute:
        $ref: 'slb_instance_config/slb_700_post_route_iac3.lua'
      slb750respheaderfilter:
        $ref: 'slb_instance_config/slb_750_resp_header_filter_iac3.lua'
      slb800respbodyfilter:
        $ref: 'slb_instance_config/slb_800_resp_body_filter_iac3.lua'

nginx配置

slb_instance_config/nginx.conf #nginx默认配置

#user  slb slb;
worker_processes auto;
#worker_cpu_affinity 0001 0010 0100 1000;
pid        logs/nginx.pid;
#####################################################################
### default: close the error log
error_log  /dev/null crit;
# nofile per worker around 20000-100000 is ok, eg, if have 8 worker, nginx will use no more than 8*worker_rlimit_nofile nofile, should make this result less than system nofile.
worker_rlimit_nofile 51200;
events {
    use epoll;
    # connections per worker, usually setup same or similar value as worker_rlimit_nofile.
    worker_connections 51200;
}
http {
    #####################################################################
    ### load basic lua script
    include 'lua/nginx.http.lua.conf';
    init_by_lua_file 'conf/lua/initial.lua';
    init_worker_by_lua_file 'conf/lua/initialworker.lua';
    log_by_lua_file 'conf/lua/monitor/logrequest.lua';
    #rewrite_by_lua_no_postpone on;
    #####################################################################
    uninitialized_variable_warn off;
    server_tokens off;
    autoindex off;
    port_in_redirect off;
    ssi off;
    proxy_hide_header x-powered-by;
    add_header x-xss-protection "1; mode=block";
    add_header x-frame-options sameorigin;
    add_header x-content-type-options  nosniff;
    add_header strict-transport-security "max-age=31536000; includesubdomains ";
    add_header content-security-policy "default-src 'self'";
    add_header cache-control "no-cache, no-store, must-revalidate";
    add_header pragma no-cache;
    add_header expires 0;
    client_header_timeout 60s;
    client_body_timeout 60s;
    keepalive_timeout 75s;
    send_timeout 60s;
    client_header_buffer_size 1k;
    large_client_header_buffers 4 8k;
    client_body_buffer_size 16k;
    client_max_body_size 1m;
    proxy_buffer_size 8k;
    proxy_buffers 8 8k;
    proxy_busy_buffers_size 16k;
    include mime.types;
    default_type text/html;
    #####################################################################
    ### gzip compress
    gzip on;
    gzip_http_version 1.1;
    gzip_comp_level 5;
    gzip_min_length 1k;
    gzip_disable "msie [1-6].";
    gzip_types
        text/plain text/css text/xml text/javascript
        application/json application/x-javascript application/xml application/xml rss application/xhtml xml;
    #####################################################################
    ### enabled the error page  process
    fastcgi_intercept_errors on;
    error_page 400 401 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 /4xx.html;
    error_page 500 501 502 503 504 505 /5xx.html;
    #####################################################################
    ### log format and switch.
    log_format  main  '$time_local|$request_time|$upstream_response_time|$uri'
        '|$status|$body_bytes_sent|$request_length|$bytes_sent|$http_user_agent|$http_host'
        '|$upstream_addr|$upstream_status|$scheme|$is_grey_server|$resp_status|$server_protocol';
    access_log logs/access.log  main buffer=5m flush=10s;
    log_format  bigdata  '$time_local|$server_addr|$upstream_addr|$is_grey_server|$uri'
        '|$upstream_status|$resp_status|$request_time|$upstream_response_time|$request_length|$bytes_sent|$connections_active|$target_all|$remote_addr'
        '|$http_x_forwarded_for|$request_method|$http_user_agent|$status|$http_referer|$server_protocol|$body_bytes_sent|$request_length|$http_host|$request'
        '|$server_port|-|$http_x_api_method||||||||||';
    access_log logs/access_for_big_data.log  bigdata buffer=5m flush=10s;
    #####################################################################
    ### load sub configure
    include vhosts/*.conf;
    include slb_conf/*.conf;
}

重写重定向配置

表2 urlresetconf字段说明

参数名

类型

是否必选

说明

transfertype

string

是

转换类型,为以下枚举值:

  • rewritegrey:灰度重写
  • rewritenormal:生产重写
  • redirectgrey:灰度重定向
  • redirectnormal:生产重定向

source

string

是

匹配路径,例:/abc/portal/login.jsp(.*)$

target

string

是

目标路径,例:/abc/def/$1

slb_instance_config/url_reset_config.yaml #重写重定向配置

- transfertype: rewritenormal               #必填,转发类型,rewritenormal代表生产重写
  source: /a1                               #必填,匹配路径
  target: /b1                               #必填,目标路径
- transfertype: rewritegrey                 #必填,转发类型,rewritegrey代表灰度重写
  source: /a2                               #必填,匹配路径
  target: /b2                               #必填,目标路径

内网段配置

表3 innersegmentsconf字段说明

参数名

类型

是否必选

说明

segment

string

是

ip地址段,格式为ip/子网掩码。

slb_instance_config/inner_segments_config.yaml #内网段配置

- segment: 10.0.0.0/8               
- segment: 127.0.0.1/32
- segment: 172.16.0.0/12
- segment: 192.168.0.0/16
- segment: 100.125.0.0/16

降级配置

表4 degradeconf

参数名

类型

是否必选

说明

switchstatus

string

是

降级开关,取值为on或off。

degradeurl

string

否

修改时必传,不传表示置空此项,取值<=500。

currentlevel

int

是

当前降级等级,取值为整数1到5。

defaultlevel

int

是

接口默认等级,取值为整数1到5。

ruleitems

list<degraderule>

当降级开关为on时必填

当降级开关为off时非必填

降级列表,每个等级只能有一个。

表5 degraderule

参数名

类型

是否必选

说明

level

string

是

降级等级,取值为1-5之间。

values

int

是

降级规则,对应等级的匹配规则表达式,例如:

path equal[/abc/def,abc/ghi]

<=100000

slb_instance_config/degrade_config.yaml #降级配置

switchstatus: 'on'                           #必填,降级开关,取值为off或on
defaultlevel: 4                              #必填,接口默认等级,取值为整数1到5
currentlevel: 3                              #必填,当前降级等级,取值为整数1到5
degradeurl: @xxx                             #非必填,降级url
ruleitems:                                   #降级规则信息
  - level: 1                                 #必填,等级
    values: head[appid] equal[1,2,3]         #必填,降级规则
  - level: 2
    values: head[appid] equal[4,5,6]

黑白名单配置

表6 blacklistconf/viplistconf字段说明

参数名

类型

是否必选

说明

switchstatus

string

是

开关,取值为on或off。

groups

list<blackviplistgroup>

是

名单列表

degradeurl

string

否

定制响应location,以@olc_degrade开头,当不传递时,表示置空该字段。

表7 blackviplistgroup

参数名

类型

是否必选

说明

ruleitems

list<blackviplistrule>

是

规则列表

表8 blackviplistrule

参数名

类型

是否必选

说明

type

string

是

匹配项类型,取值为:path、left-ip、right-ip、custom。

param

string

否

参数名,长度<=50

type为custom时必传,其他type无需传递。

position

string

否

位置

  • type为custom时必传,为以下枚举值:querystring、header、resource、body-json、body-form。
  • 当type为path、left-ip、right-ip时无需传递。

match

string

是

匹配条件

  • 当type为left-ip或right-ip时,仅支持:sha256和rangeip。
  • 当type为custom或path时,仅支持:equal、sha256、pattern。

values

string

是

对应匹配的值

  • match为equal时,例如填写1,2,3,表示1或2或3都可匹配。
  • 当match为rangeip时,填写样例:

    10.1.1.1-10.1.1.100,10.2.2.1-10.2.2.100

  • match为sha256时,填写样例:5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5, 226fe7d26af82de76db083e6a29524ca68f4aaf80f2c2db058571fdb8f1fdeea
  • match为pattern时,填写样例:

    ^abc

    <=102400

slb_instance_config/blacklist_config.yaml #黑名单配置

switchstatus: 'on'                                 #必填,黑名单开关,取值为off或on
degradeurl: @xxx                                   #非必填,降级url
groups:                                            #必填,黑名单组
  - ruleitems:                                     #必填,组内规则
    - type: custom                                 #必填,类型
      param: x-app-id                              #非必填,参数
      position: header                             #非必填,位置
      match: equal                                 #必填,匹配条件
      values: '[1,2,3]'                            #必填,值

slb_instance_config/viplist_config.yaml #白名单配置

switchstatus: 'on'                                     #必填,白名单开关,取值为off或on
groups:                                                #必填,白名单列表
  - ruleitems:                                         #必填,组内规则
    - type: custom                                     #必填,类型
      param: x-app-id                                  #非必填,参数
      position: header                                 #非必填,位置
      match: equal                                     #必填,匹配条件
      values: '[1,2,3]'                                #必填,值

流控配置

表9 flowcontrolconf字段说明

参数名

类型

是否必选

说明

flowcontrolswitch

string

是

流控总开关,取值为on或off。

autodivideswitch

string

是

分摊模式开关,取值为on或off。

flowcontrolorder

string

是

流控类型执行顺序,和下面的流控配置相匹配。

nodeflowcontrol

flowcontroltypebean

否

节点级流控配置

interfaceflowcontrol

flowcontroltypebean

否

接口级流控配置

serviceflowcontrol

flowcontroltypebean

否

服务级流控配置

ipflowcontrol

flowcontroltypebean

否

ip流控配置

singleparamflowcontrol

flowcontroltypebean

否

自定义参数流控配置

multiparamflowcontrol

flowcontroltypebean

否

多参数组合流控配置

quotaflowcontrol

flowcontroltypebean

否

配额流控配置

concurrentflowcontrol

flowcontroltypebean

否

并发连接流控配置

表10 flowcontroltypebean

参数名

类型

是否必选

说明

switchstatus

string

是

流控开关,取值为on或off

degradeurl

string

是

降级url,长度<500

limit

int

是

每秒请求量

burst

int

是

突发请求量

limittag

string

否

自定义标签,长度<=200

ruleitems

list<flowcontrolrule>

否

匹配规则列表

configgroups

list<flowcontrolgroup>

否

匹配规则组列表

表11 flowcontrolrule

参数名

类型

是否必选

说明

type

string

否

匹配项类型,为以下枚举:path、left-ip、right-ip、custom。

param

string

否

参数名,长度<50。

type为custom时必传,其他type无需传递。

position

string

否

位置

  • type为custom时必传,以下枚举值:querystring、header、resource、body-json、body-form、url。
  • 其他type无需传递。

match

string

是

参数匹配方式

  • 当type为left-ip或right-ip时,仅支持:sha256和rangeip。
  • 当type为custom或path时,仅支持:equal、sha256、pattern。

values

string

是

对应匹配的值

  • match为equal时,例如填写1,2,3,表示1或2或3都可匹配。
  • 当match为rangeip时,填写样例:

    10.1.1.1-10.1.1.100,10.2.2.1-10.2.2.100

  • match为sha256时,填写样例:5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5, 226fe7d26af82de76db083e6a29524ca68f4aaf80f2c2db058571fdb8f1fdeea
  • match为pattern时,填写样例:

    ^abc

    <=102400

isagg

string

否

是否聚合,0不聚合 1 聚合,默认不聚合

limit

int

否

limit大小

接口级流控,ip流控,服务级流控,单参数流控必填,其他类型流控无效

burst

int

否

突发量

接口级流控,ip流控,服务级流控,单参数流控必填,其他类型流控无效

limittag

string

否

自定义标签

<=200

表12 flowcontrolgroup

参数名

类型

是否必选

说明

timewindow

int

否

配额周期,正整数。

timewindow配合timeunit,最多不超过86400秒,或不超过1440分钟,或不超过24小时,或不超过1天。

timeunit

string

否

时间单位,取值为second、minute、hour、day。

limit

int

是

限流数量。

burst

int

否

突发量。

ruleitems

list< flowcontrolrulebean >

是

匹配规则列表。

slb_instance_config/flow_control_config.yaml #流控配置

flowcontrolswitch: 'on'                            #必填,流控总开关,取值为off或on
autodivideswitch: 'off'                            #必填,分摊模式开关,取值为off或on
flowcontrolorder: nodeflowcontrol,urlflowcontrol   #必填,流控类型顺序;和下面的流控配置相匹配
nodeflowcontrol:                                   #非必填,节点级流控
  switchstatus: 'on'                               #必填,节点级流控开关,取值为off或on
  degradeurl: xxx                                  #非必填,限流降级url
  limit: 1000                                      #必填,流控值
  burst: 1000                                      #必填,突发量
  limittag: xxxx                                   #非必填,自定义标签
serviceflowcontrol:                                #非必填,服务级流控
  switchstatus: 'on'
  degradeurl: xxx
  limit: 1000
  burst: 1000
  ruleitems:                                       #必填,流控规则
    - match: equal                                 #必填,匹配条件;取值有equal,pattern
      values: example.com                          #必填,域名值
      limit: 1000                                  #必填,流控值
      burst: 1000                                  #必填,突发量
      limittag: xxxx                               #非必填,自定义标签
interfaceflowcontrol:                              #非必填,接口级流控
  switchstatus: 'on'
  degradeurl: xxx
  limit: 1000
  burst: 1000
  ruleitems:
    - match: equal                                 #必填,匹配条件;取值有equal,pattern
      values: xxx                                  #必填,接口url
      limit: 1000                                  #必填,流控值
      burst: 1000                                  #必填,突发量
      limittag: xxxx                               #非必填,自定义标签
      isagg: off                                   #非必填,聚合统计开关
ipflowcontrol:                                     #非必填,ip流控
  switchstatus: 'on'
  degradeurl: xxx
  limit: 1000
  burst: 1000
  ruleitems:
    - type: left-ip                                #必填,类型
      match: rangeip                               #必填,匹配条件
      values: 1.1.1.1-1.1.1.2                      #必填,值
      limit: 1000                                  #必填,流控值
      burst: 1000                                  #必填,突发量
      limittag: xxxx                               #非必填,自定义标签
singleparamflowcontrol:                            #非必填,自定义参数流控
  switchstatus: 'on'
  degradeurl: xxx
  ruleitems:
    - param: xxx                                   #必填,参数
      position: url                                #必填,位置
      match: equal                                 #必填,匹配条件
      values: 1                                    #必填,值
      limit: 1000                                  #必填,流控值
      burst: 1000                                  #必填,突发量
      limittag: xxxx                               #非必填,自定义标签
multiparamflowcontrol:                             #非必填,多参数组合流控 
  switchstatus: 'on'
  degradeurl: xxx
  configgroups:                                    #必填,配置组
    - limit: 1000                                  #必填,组流控值
      burst: 1000                                  #必填,组突发量
      limittag: xxxx                               #非必填,自定义标签
      ruleitems:                                   #必填,流控规则
        - type: path                               #必填,类型
          param:                                   #非必填,参数
          position:                                #非必填,位置
          match: equal                             #必填,匹配条件
          values: /a                               #必填,值
          isagg: 'off'                             #非必填,聚合统计开关
        - type: custom
          param: zzz
          position: querystring
          match: equal
          values: 1
          isagg: off
quotaflowcontrol:                                 #非必填,配额流控
  switchstatus: 'on'
  degradeurl: @example.com
  configgroups:                                   #必填,配置组
    - timewindow: 10                              #必填,时间周期窗口
      timeunit: minute                            #必填,时间单位
      limit: 1000                                 #必填,配额大小
      limittag: xxxx                              #非必填,自定义标签
      ruleitems:                                  #必填,流控规则
        - type: path                              #必填,类型
          param:                                  #非必填,参数
          position:                               #非必填,位置 
          match: equal                            #必填,匹配条件
          values: /a                              #必填,值
          isagg: 'off'                            #非必填,聚合统计开关
        - type: custom
          param: zzz
          position: querystring
          match: equal
          values: 1
          isagg: off
concurrentflowcontrol:                           #非必填,并发连接流控 
  switchstatus: 'on'
  degradeurl: xxx
  configgroups:                                  #必填,配置组
    - limit: 1000                                #必填,流控值
      burst: 1000                                #必填,突发量
      limittag: xxxx                             #非必填,自定义标签
      ruleitems:                                 #必填,流控规则
        - type: path                             #必填,类型
          param:                                 #非必填,参数
          position:                              #非必填,位置
          match: equal                           #必填,匹配条件
          values: /a                             #必填,值
        - type: custom
          param: zzz
          position: querystring
          match: equal
          values: 1

其他配置

表13 confluaconf字段说明

参数名

说明

addgreyflag

灰度标记开关,取值为on或off。

greytestswitch

灰度测试开关,取值为on或off。

greytestserviceid

灰度测试服务id。

greytestswitch为on时必传。

getiptype

取ip方式,取值为1或2,1表示从左取,2表示从右取,默认为1。

isbypassongreydown

灰度服务器全部宕机后,请求路由到生产开关,取值为on或off,默认为off。

areagreygetipfromleft

地域灰度ip从左侧取值开关,取值为on或off,默认为off。

greytestqpslimit

灰度测试每秒转发量限制,取值为1到1000。

successratealarmabsthreshold

成功率告警阈值绝对值,非负浮点数,取值为0到100,默认值为90。

successratealarmoffsetthreshold

成功率下降告警阈值(相比1分钟前或者5分钟前),非负浮点数,取值为0到100,默认值为5。

healthcheckalarmservercountthreshold

健康检查不健康机器数告警阈值,正整数,默认为1,表示有1台节点不健康就会告警。

healthcheckalarmdurationthreshold

健康检查告警持续时间阈值,非负正整数,默认为0,表示不健康主机立即告警;如果配置为1,表示发现不健康持续1分钟以上,才会告警。

concurrentflowcontrolalarmthreshold

并发请求流控告警阈值,非负整数,默认为0,表示只要发生1次流控,就会告警。

serviceflowcontrolalarmthreshold

服务级流控告警阈值,非负整数,默认0,表示只要发生1次流控,就会告警。

singleparamflowcontrolalarmthreshold

自定义参数流控告警阈值,非负整数,默认0,表示只要发生1次流控,就会告警。

multiparamflowcontrolalarmthreshold

多参数流控告警阈值,非负整数,默认0,表示只要发生1次流控,就会告警。

quotaflowcontrolalarmthreshold

配额流控告警阈值,非负整数,默认0,表示只要发生1次流控,就会告警。

manyrequestprealarmthreshold

请求数过多告警阈值,正整数,例如:25000,表示每个cpu每分钟平均处理达到25000请求,则触发告警。

以4c的主机为例,1分钟处理超过25000*4=100000请求,则开始告警。

manyrequestalarmthreshold

请求数警阈值,非负整数,默认为0。

statisticsparams

统计日志参数,格式为paramname:position。

  • paramname为参数名称。
  • position为参数位置,取值为querystring或header。

slb_instance_config/conf_lua_config.yaml #其他配置

addgreyflag: 'off'                                          #非必填,灰度标记开关,取值为off或on
greytestswitch: 'off'                                       #非必填,灰度测试开关,取值为off或on
greytestserviceid: 123456                                   #非必填,灰度测试服务id
isbypassongreydown: 'off'                                   #非必填,宕机时路由到生产集群开关,取值为off或on
areagreygetipfromleft: 'off'                                #非必填,地域灰度ip从左取值开关 ,取值为off或on
getiptype: 1                                                #非必填,取ip方式,取值为1或2
statisticsparams:                                           #非必填,统计日志参数
greytestqpslimit: 1000                                     #非必填,灰度测试每秒转发量限制,取值为1到1000
manyrequestalarmthreshold: 1000                             #非必填,请求数量告警 
successratealarmabsthreshold: 90                            #非必填,成功率告警阈值,取值为0到100
successratealarmoffsetthreshold: 90                         #非必填,成功率下降告警阈值,取值为0到100
healthcheckalarmservercountthreshold: 1000                  #非必填,健康检查告警阈值
healthcheckalarmdurationthreshold: 1000                     #非必填,健康告警持续时间阈值
concurrentflowcontrolalarmthreshold: 1000                   #非必填,并发连接流控告警阈值
serviceflowcontrolalarmthreshold: 1000                      #非必填,服务级流控告警阈值
multiparamflowcontrolalarmthreshold: 1000                   #非必填,多参数流控告警阈值
singleparamflowcontrolalarmthreshold: 1000                  #非必填,自定义参数流控告警阈值
quotaflowcontrolalarmthreshold: 1000                        #非必填,配额流控告警阈值
manyrequestprealarmthreshold: 1000                          #非必填,请求数量预告警

自定义lua配置

表14 customluaconf字段说明

参数名

类型

是否必选

说明

slb100globalinit

string

否

大小不得超过16kb

slb200workerinit

string

否

大小不得超过16kb

slb300preflowcontrol

string

否

大小不得超过16kb

slb400onflowcontroled

string

否

大小不得超过16kb

slb500pregrey

int

否

大小不得超过16kb

slb600postgrey

string

否

大小不得超过16kb

slb700postroute

string

否

大小不得超过16kb

slb750respheaderfilter

int

否

大小不得超过16kb

slb800respbodyfilter

float

否

大小不得超过16kb

slb_instance_config/slb_100_global_init_iac3.lua #slb_100_global_init_iac3.lua默认配置

--the custom point slb_100_global_init, running when global init.
--will be triggered in exec function, so pls make sure there is a exec function in global_init
local global_init = {};
function global_init.exec(gen_param)
    --eg:ngx.log(ngx.err,"i am in global_init")
end
return global_init

slb_instance_config/slb_200_worker_init_iac3.lua #slb_200_worker_init_iac3.lua默认配置

--the custom point slb_200_worker_init, running when worker init.
--will be triggered in exec function, so pls make sure there is a exec function in worker_init
local worker_init = {};
function worker_init.exec(gen_param)
    --eg:ngx.log(ngx.err,"i am in worker init");
end
return worker_init

slb_instance_config/slb_300_pre_flowcontrol_iac3.lua #slb_300_pre_flowcontrol_iac3.lua默认配置

--the custom point slb_300_pre_flowcontrol, running before flowcontrol and blacklist.
--will be triggered in exec function, so pls make sure there is a exec function in pre_flowcontrol
local pre_flowcontrol = {};
function pre_flowcontrol.exec(gen_param)
    --eg:ngx.log(ngx.err,"i am in pre flowcontrol")
end
return pre_flowcontrol

slb_instance_config/slb_400_on_flowcontroled_iac3.lua #slb_400_on_flowcontroled_iac3.lua默认配置

--the custom point slb_400_on_flowcontrolled, running when request is flowcontrolled or blocked due to blacklist.
--will be triggered in exec function, so pls make sure there is a exec function in on_flowcontroled
local on_flowcontroled = {};
function on_flowcontroled.exec(gen_param)
    --eg:ngx.log(ngx.err,"the flowcontrol type is:",gen_param.control_type)
end
return on_flowcontroled

slb_instance_config/slb_500_pre_grey_iac3.lua #slb_500_pre_grey_iac3.lua默认配置

--the custom point slb_500_pre_grey, running before greyrule judge.
--will be triggered in exec function, so pls make sure there is a exec function in pre_grey
local pre_grey = {};
function pre_grey.exec(gen_param)
    --eg:ngx.log(ngx.err,"i am in pre grey");
end
return pre_grey

slb_instance_config/slb_600_post_grey_iac3.lua #slb_600_post_grey_iac3.lua默认配置

--the custom point slb_600_post_grey, running after get result of greyrule.
--will be triggered in exec function, so pls make sure there is a exec function in post_grey
local post_grey = {};
function post_grey.exec(gen_param)
    --eg:ngx.log(ngx.err,"i am in post grey");
end
return post_grey

slb_instance_config/slb_700_post_route_iac3.lua #slb_700_post_route_iac3.lua默认配置

--the custom point slb_700_post_route, running after get result of routerule.
--will be triggered in exec function, so pls make sure there is a exec function in post_route
local post_route = {};
function post_route.exec(gen_param)
    --eg:ngx.log(ngx.err,"i am in post route");
end
return post_route

slb_instance_config/slb_750_resp_header_filter_iac3.lua #slb_750_resp_header_filter_iac3.lua默认配置

--the custom point slb_750_resp_header_filter, running during header filter.
--will be triggered in exec function, so pls make sure there is a exec function in header_filter
local header_filter = {};
function header_filter.exec(gen_param)
    --eg:ngx.log(ngx.err,"i am in header filter");
end
return header_filter

slb_instance_config/slb_800_resp_body_filter_iac3.lua #slb_800_resp_body_filter_iac3.lua默认配置

--the custom point slb_800_resp_body_filter, running during body filter.
--will be triggered in exec function, so pls make sure there is a exec function in body_filter
local body_filter = {};
function body_filter.exec(gen_param)
    --eg:ngx.log(ngx.err,"i am in body filter");
end
return body_filter

相关文档

网站地图