- 简介
- 配置
- 服务基础配置
- TLS基础配置
- TLS Session Cache相关配置
- TLS Session Ticket相关配置
- 示例
简介
bfe.conf是BFE的核心配置。
配置
服务基础配置
| 配置项 |
类型 |
描述 |
| HttpPort |
Int |
HTTP监听端口 |
| HttpsPort |
Int |
HTTPS(TLS)监听端口 |
| MonitorPort |
Int |
Monitor监听端口 |
| MaxCpus |
Int |
最大使用CPU核数; 0代表使用所有CPU核 |
| Layer4LoadBalancer |
String |
四层负载均衡器类型 (PROXY/BGW/NONE) |
| TlsHandshakeTimeout |
Int |
TLS握手超时时间,单位为秒 |
| ClientReadTimeout |
Int |
读客户端超时时间,单位为秒 |
| ClientWriteTimeout |
Int |
写客户端超时时间,单位为秒 |
| GracefulShutdownTimeout |
Int |
优雅退出超时时间,单位为秒,最大300秒 |
| KeepAliveEnabled |
Bool |
与用户端连接是否启用HTTP KeepAlive |
| MaxHeaderBytes |
Int |
请求头部的最大长度,单位为Byte |
| MaxHeaderUriBytes |
Int |
请求头部URI的最大长度,单位为Byte |
| HostRuleConf |
String |
租户域名表配置文件 |
| VipRuleConf |
String |
租户VIP表配置文件 |
| RouteRuleConf |
String |
转发规则配置文件 |
| ClusterConf |
String |
后端集群相关配置文件 |
| GslbConf |
String |
子集群级别负载均衡配置文件(GSLB) |
| ClusterTableConf |
String |
实例级别负载均衡配置文件 |
| NameConf |
String |
名字与实例映射表配置文件 |
| Modules |
String |
启用的模块列表; 启用多个模块请增加多行Modules配置,详见下文示例 |
| MonitorInterval |
Int |
Monitor数据统计周期 |
| DebugServHttp |
Bool |
是否开启反向代理模块调试日志 |
| DebugBfeRoute |
Bool |
是否开启流量路由模块调试日志 |
| DebugBal |
Bool |
是否开启负载均衡模块调试日志 |
| DebugHealthCheck |
Bool |
是否开启健康检查模块调试日志 |
TLS基础配置
| 配置项 |
类型 |
描述 |
| ServerCertConf |
String |
服务端证书与密钥的配置文件 |
| TlsRuleConf |
String |
TLS协议参数配置文件 |
| CipherSuites |
String |
启用的加密套件列表; 启用多个套件请增加多行cipherSuites配置,详见下文示例 |
| CurvePreferences |
String |
启用的ECC椭圆曲线 ,详见下文示例 |
| EnableSslv2ClientHello |
Bool |
针对SSLv3协议,启用对SSLv2格式ClientHello的兼容 |
| ClientCABaseDir |
String |
客户端根CA证书基目录 注意:证书文件后缀约定必须是 “.crt” |
TLS Session Cache相关配置
| 配置项 |
类型 |
描述 |
| SessionCacheDisabled |
Bool |
是否禁用TLS Session Cache机制 |
| Servers |
String |
Cache服务的访问地址 |
| KeyPrefix |
String |
缓存key前缀 |
| ConnectTimeout |
Int |
连接Cache服务的超时时间, 单位毫秒 |
| ReadTimeout |
Int |
读取Cache服务的超时时间, 单位毫秒 |
| WriteTimeout |
Int |
写入Cache服务的超时时间, 单位毫秒 |
| MaxIdle |
Int |
与Cache服务的最大空闲长连接数 |
| SessionExpire |
Int |
存储在Cache服务中会话信息的过期时间, 单位秒 |
TLS Session Ticket相关配置
| 配置项 |
类型 |
描述 |
| SessionTicketsDisabled |
Bool |
是否禁用TLS Session Ticket |
| SessionTicketKeyFile |
String |
Session Ticket Key文件路径 |
示例
[server]# listen port for http requesthttpPort = 8080# listen port for https requesthttpsPort = 8443# listen port for monitor requestmonitorPort = 8299# max number of CPUs to use (0 to use all CPUs)maxCpus = 0# type of layer-4 load balancer (PROXY/BGW/NONE)## Note:# - PROXY: layer-4 balancer talking the proxy protocol# eg. F5 BigIP/Citrix ADC# - BGW: Baidu GateWay# - NONE: layer-4 balancer disabledlayer4LoadBalancer = ""# tls handshake timeout, in secondstlsHandshakeTimeout = 30# read timeout, in secondsclientReadTimeout = 60# write timeout, in secondsclientWriteTimeout = 60# if false, client connection is shutdown disregard of http headerskeepAliveEnabled = true# timeout for graceful shutdown (maximum 300 sec)gracefulShutdownTimeout = 10# max header length in bytes in requestmaxHeaderBytes = 1048576# max URI(in header) length in bytes in requestmaxHeaderUriBytes = 8192# routing related confhostRuleConf = server_data_conf/host_rule.datavipRuleConf = server_data_conf/vip_rule.datarouteRuleConf = server_data_conf/route_rule.dataclusterConf = server_data_conf/cluster_conf.data# load balancing related confgslbConf = cluster_conf/gslb.dataclusterTableConf = cluster_conf/cluster_table.data# naming related confnameConf = server_data_conf/name_conf.data# moduels enabledmodules = mod_trust_clientipmodules = mod_blockmodules = mod_headermodules = mod_rewritemodules = mod_redirectmodules = mod_logid# interval for get diff of proxy-statemonitorInterval = 20# debug flagsdebugServHttp = falsedebugBfeRoute = falsedebugBal = falsedebugHealthCheck = false[httpsBasic]# tls cert confserverCertConf = tls_conf/server_cert_conf.data# tls ruletlsRuleConf = tls_conf/tls_rule_conf.data# supported cipherSuites preference settings## ciphersuites implemented in golang:# TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256# TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256# TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256# TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256# TLS_ECDHE_RSA_WITH_RC4_128_SHA# TLS_ECDHE_ECDSA_WITH_RC4_128_SHA# TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA# TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA# TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA# TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA# TLS_RSA_WITH_RC4_128_SHA# TLS_RSA_WITH_AES_128_CBC_SHA# TLS_RSA_WITH_AES_256_CBC_SHA# TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA# TLS_RSA_WITH_3DES_EDE_CBC_SHA## Note:# -. Equivalent cipher suites (cipher suites with same priority in server side):# cipherSuites=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256|TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256# cipherSuites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256|TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256#cipherSuites=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256|TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256cipherSuites=TLS_ECDHE_RSA_WITH_RC4_128_SHAcipherSuites=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHAcipherSuites=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHAcipherSuites=TLS_RSA_WITH_RC4_128_SHAcipherSuites=TLS_RSA_WITH_AES_128_CBC_SHAcipherSuites=TLS_RSA_WITH_AES_256_CBC_SHA# supported curve perference settings## curves implemented in golang: # CurveP256 # CurveP384 # CurveP521## Note:# - Do not use CurveP384/CurveP521 which is with poor performance#curvePreferences=CurveP256# support Sslv2 ClientHello for compatible with ancient # TLS capable clients (mozilla 5, java 5/6, openssl 0.9.8 etc)enableSslv2ClientHello = true# base directory of client ca certificates# Note: filename suffix of ca certificate file should be ".crt"clientCABaseDir = tls_conf/client_ca[sessionCache]# disable tls session cache or notsessionCacheDisabled = true# address of cache serverservers = "example.redis.cluster"# prefix for cache keykeyPrefix = "bfe"# connection params (ms)connectTimeout = 50readTimeout = 50writeTimeout = 50# max idle connections in connection poolmaxIdle = 20# expire time for tls session state (second)sessionExpire = 3600[sessionTicket]# disable tls session ticket or notsessionTicketsDisabled = true# session ticket keysessionTicketKeyFile = tls_conf/session_ticket_key.data