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

slb监听配置-j9九游会登录

本章介绍通过iac进行slb监听配置的管理,包括监听的域名、端口、协议、证书、监听级别的高级配置,对应的资源类型为wisecloud::loadbalancer::slb::listenergroup。

表1 slb监听配置字段说明

参数名

类型

是否必选

说明

instancename

string

是

关联的slb实例名,仅能关联同一注册中心下的slb实例。

domain

string

否

域名,多个域名不可重复,只允许数字、字母、下划线、“.”和“*”。

certificate

string

否

证书名,需为领域下已录入证书。

listeners

list<portconfig>

是

监听端口列表。

config

gereralandadvancedconfigbean

否

通用及高级配置。

表2 portconfig

参数名

类型

是否必选

说明

port

string

是

监听端口,整型字符串,1-65535。

protocol

string

是

协议,取值为:http、https、http2、http2(ssl)。

otherconfig

string

否

其他配置。

elbreferences

list<elbpoolconfig>

当所关联slb实例为自管理模式时非必传

elb关联列表。

表3 elbpoolconfig

参数名

类型

是否必选

说明

name

string

否

elb名称,elb名称可在ens管理台查询。

pool

string

否

elb后端集群。

样例:

- name: testlistenername                             #必传,slb监听名称,长度<=50,不能包含-in-字符,不能以in-开头,不能以.conf结尾,不能包含特殊字符
  type: wisecloud::loadbalancer::slb::listenergroup  #资源类型为监听配置
  properties:
    instancename: testslbinstancename                #必传,关联的slb实例名,仅能关联同一注册中心下的slb实例
    domain: www.test1.com,www.test2.com              #非必传,域名
    certificate: testcertificatename                 #非必传,证书,需为领域下已录入证书
    listeners:                                       #必传
      - protocol: https                              #必传,协议,取值为:http、https、http2、http2(ssl)
        port: '9095'                                 #必传,整型字符串,监听端口,1-65535
        elbreferences:                               #elb关联列表
          - name: elbname1                           #elb名称
            pool: elbpool1                           #elb后端集群   
          - name: elbname2
            pool: elbpool2
        otherconfig:                                 #非必传
      - protocol: https
        port: '9096'
        elbreferences:
          - name: elbname3
            pool: elbpool3
          - name: elbname4
            pool: elbpool4
    config:                                         #非必传,监听通用配置和高级配置
      $ref: 'slb_listener_config/listener_monitor_config.yaml#'

配置监听

表4 slb监听配置config字段说明

参数名

类型

是否必选

说明

proxyreadtimeout

int

否

响应超时时间,不超过10位的数字。

proxysendtimeout

int

否

转发超时时间,不超过10位的数字。

keepaliveswitch

string

否

启用长连接转发,是否keepalive,取值为on或off。

hostswitch

string

否

是否透传请求头,取值为on或off,不填或者其他字符均为off。

xforwardedforswitch

string

否

是否追加xff,取值为on或off。

accesslogswitch

string

否

是否开启access日志,取值为on或off,不填或者其他字符均为off。

proxynextupstreamswitch

string

否

是否在异常时尝试下一台,取值为on或off,不填或者其他字符均为off。

proxynextupstreamcondition

string

否

设置尝试下一台场景,"403"、"404"、"429"、"500"、"502"、"503"、"504"、"error"、"timeout"、"invalid_header"。

clientconnectionfreetime

int

否

客户端连接空闲时间,长度不超过10位的正整数。

proxybuffersswitch

string

否

开启响应缓存,取值为on或off,不填或者其他字符均为off。

proxybufferssize

string

否

响应缓存大小,由数字 空格 k/m组成,默认为8 k。

expiresswitch

string

否

高级配置中expires开关,取值为on或off,不填或者其他字符均为off。

expiressize

string

否

设定页面缓存时间,不缓存或一直使用缓存。可以由字母、数字、空格、$、@、 、-、冒号、逗号组成,长度不超过50位。

indexpage

string

否

静态页面场景index页面设置,长度不超过255,非中文。

returnval

string

否

固定返回响应码,长度不超过255,非中文。

allowmethod

string

否

允许的http方法,对于转发策略有效,对于监听仅为参考,在界面新增转发策略时会继承监听的此项配置,其余场景无效,"get"、"head"、"post"、"delete"、"put"、"options"、"patch"、"mkcol"、"copy"、"move"、"propfind"、"proppatch"、"lock"、"unlock"。

command

string

否

nginx配置命令,非中文。

root

string

否

默认资源根目录,长度不超过500,非中文。

clientmaxbodysize

string

否

最大请求体大小,数字 空格 k/m组成。

clientbodybuffersize

string

否

请求体buffer大小,数字 空格 k/m组成。

addheaders

list<generalkeyvalueconfig>

否

响应头

setvals

list<generalkeyvalueconfig>

否

对应页面set

proxysetheaders

list<generalkeyvalueconfig>

否

请求头

redirects

list<generalredirectconfig>

否

重定向

rewrites

list<generalredirectconfig>

否

重写

表5 generalkeyvalueconfig

参数名

类型

是否必选

说明

key

string

否

键,非中文

value

string

否

值,非中文

表6 generalredirectconfig

参数名

类型

是否必选

说明

source

string

否

匹配规则,非中文。

target

string

否

重写/重定向目标,非中文。

option

string

否

重写标记,取值为:"last"、"break"、"permanent"。

slb_listener_config/listener_monitor_config.yaml

hostswitch: 'on'                      #是否透传请求头,on/off,不填或者其他字符均为off
      root:                           #默认资源根目录,不超过500非中文
      clientconnectionfreetime: 100   #客户端连接空闲时间,不超过10位的正整数
      proxyreadtimeout: 70            #响应超时时间,不超过10位的数字
      keepaliveswitch: 'on'           #启用长连接转发是否keepalive,on/off
      proxybufferssize: '2 m'         #响应缓存大小,数字 空格 k/m组成,默认为8 k
      expiresswitch: 'on'             #高级配置中expires开关,on/off,不填或者其他字符均为off
      proxybuffersswitch: 'on'        #开启响应缓存,on/off,不填或者其他字符均为off
      accesslogswitch: 'on'           #是否开启access日志,on/off,不填或者其他字符均为off
      returnval: 200                  #固定返回响应码,不超过255非中文
      allowmethod: post,get,head,put,delete,options    #允许的http方法
      nuwatraceswitch: 'off'
      command:                        #nginx配置命令,非中文
      clientmaxbodysize:              #最大请求体大小,数字 空格 k/m组成
      clientbodybuffersize: 10        #请求体buffer大小,数字 空格 k/m组成
      expiressize: 10                 #设定页面缓存时间
      indexpage:                      #静态页面场景index页面设置,不超过255非中文
      proxynextupstreamcondition: error,timeout      #尝试下一台场景
      proxysendtimeout: 80            #转发超时时间,不超过10位的数字
      xforwardedforswitch: 'on'       #是否追加xff,on/off
      proxynextupstreamswitch: 'on'   #是否在异常时尝试下一台,on/off,不填或者其他字符均为off
      addheaders:                     #响应头
        - value: v1
          key: k1
        - value: v2
          key: k2
      rewrites:                       #重写
        - source: s7
          option: break
          target: t1
      setvals:                        #对应页面set
        - value: v3
          key: $k3
      proxysetheaders:                #请求头
        - value: v5
          key: k5
      redirects:                      #重定向
        - source: s1
          target: t1

相关文档

网站地图