Introduction

bfe.conf is the core config file of BFE.

Configuration

Server Config

Config Item Type Description
HttpPort Int Listen port for HTTP
HttpsPort Int Listen port for HTTPS
MonitorPort Int Listen port for monitor
MaxCpus Int Max number of CPUs to use (0 to use all CPUs)
Layer4LoadBalancer String Type of layer-4 load balancer (PROXY/BGW/NONE)
TlsHandshakeTimeout Int TLS handshake timeout, in seconds
ClientReadTimeout Int Read timeout of communicating with http client, in seconds
ClientWriteTimeout Int Write timeout of communicating with http client, in seconds
KeepAliveEnabled Bool If false, HTTP Keep-Alive is disabled
GracefulShutdownTimeout Int Timeout for graceful shutdown (maximum 300 sec)
MaxHeaderBytes Int Max length of request header, in bytes
MaxHeaderUriBytes Int Max lenght of request URI, in bytes
HostRuleConf String Path of host config
VipRuleConf String Path of VIP config
RouteRuleConf String Path of route rule config
ClusterConf String Path of cluster config
ClusterTableConf String Path of cluster table config
GslbConf String Path of gslb config
NameConf String Path of naming config
Modules String Enabled modules
MonitorInterval Int Interval for get diff of proxy-state
DebugServHttp Bool Debug flag for ServerHttp
DebugBfeRoute Bool Debug flag for BfeRoute
DebugBal Bool Debug flag for Bal
DebugHealthCheck Bool Debug flag for HealthCheck

HttpsBasic Config

Config Item Type Description
ServerCertConf String Path of cert config
TlsRuleConf String Path of tls rule config
CipherSuites String CipherSuites preference settings
CurvePreferences String Curve perference settings
EnableSslv2ClientHello Bool Enable Sslv2ClientHello for compatible with ancient sslv3 client
ClientCABaseDir String Base directory of client ca certificates Note: filename suffix of ca certificate must be “.crt”

SessionCache Config

Config Item Type Description
SessionCacheDisabled Bool Disable tls session cache or not
Servers String Address of cache server
KeyPrefix String Prefix for cache key
ConnectTimeout Int Connection timeout
ReadTimeout Int Read timeout of connection with redis server
WriteTimeout Int Write timeout of connection with redis server
MaxIdle Int Max idle connections in connection pool
SessionExpire Int Expire time for tls session state (second)

SessionTicket Config

Config Item Type Description
SessionTicketsDisabled Bool Disable tls session ticket or not
SessionTicketKeyFile String File path of session ticket key

Example

  1. [server]
  2. # listen port for http request
  3. httpPort = 8080
  4. # listen port for https request
  5. httpsPort = 8443
  6. # listen port for monitor request
  7. monitorPort = 8299
  8. # max number of CPUs to use (0 to use all CPUs)
  9. maxCpus = 0
  10. # type of layer-4 load balancer (PROXY/BGW/NONE)
  11. #
  12. # Note:
  13. # - PROXY: layer-4 balancer talking the proxy protocol
  14. # eg. F5 BigIP/Citrix ADC
  15. # - BGW: Baidu GateWay
  16. # - NONE: layer-4 balancer disabled
  17. layer4LoadBalancer = ""
  18. # tls handshake timeout, in seconds
  19. tlsHandshakeTimeout = 30
  20. # read timeout, in seconds
  21. clientReadTimeout = 60
  22. # write timeout, in seconds
  23. clientWriteTimeout = 60
  24. # if false, client connection is shutdown disregard of http headers
  25. keepAliveEnabled = true
  26. # timeout for graceful shutdown (maximum 300 sec)
  27. gracefulShutdownTimeout = 10
  28. # max header length in bytes in request
  29. maxHeaderBytes = 1048576
  30. # max URI(in header) length in bytes in request
  31. maxHeaderUriBytes = 8192
  32. # routing related confs
  33. hostRuleConf = server_data_conf/host_rule.data
  34. vipRuleConf = server_data_conf/vip_rule.data
  35. routeRuleConf = server_data_conf/route_rule.data
  36. clusterConf = server_data_conf/cluster_conf.data
  37. nameConf = server_data_conf/name_conf.data
  38. # load balancing related confs
  39. clusterTableConf = cluster_conf/cluster_table.data
  40. gslbConf = cluster_conf/gslb.data
  41. modules = mod_trust_clientip
  42. modules = mod_block
  43. modules = mod_header
  44. modules = mod_rewrite
  45. modules = mod_redirect
  46. modules = mod_logid
  47. # interval for get diff of proxy-state
  48. monitorInterval = 20
  49. debugServHttp = false
  50. debugBfeRoute = false
  51. debugBal = false
  52. debugHealthCheck = false
  53. [httpsBasic]
  54. # cert conf for https
  55. serverCertConf = tls_conf/server_cert_conf.data
  56. # tls rule for https
  57. tlsRuleConf = tls_conf/tls_rule_conf.data
  58. # supported cipherSuites preference settings
  59. #
  60. # ciphersuites implemented in golang
  61. # TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
  62. # TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
  63. # TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
  64. # TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
  65. # TLS_ECDHE_RSA_WITH_RC4_128_SHA
  66. # TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
  67. # TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
  68. # TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
  69. # TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
  70. # TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
  71. # TLS_RSA_WITH_RC4_128_SHA
  72. # TLS_RSA_WITH_AES_128_CBC_SHA
  73. # TLS_RSA_WITH_AES_256_CBC_SHA
  74. # TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
  75. # TLS_RSA_WITH_3DES_EDE_CBC_SHA
  76. #
  77. # Note:
  78. # -. Equivalent cipher suites (cipher suites with same priority in server side):
  79. # cipherSuites=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256|TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
  80. # cipherSuites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256|TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
  81. #
  82. cipherSuites=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256|TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
  83. cipherSuites=TLS_ECDHE_RSA_WITH_RC4_128_SHA
  84. cipherSuites=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
  85. cipherSuites=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
  86. cipherSuites=TLS_RSA_WITH_RC4_128_SHA
  87. cipherSuites=TLS_RSA_WITH_AES_128_CBC_SHA
  88. cipherSuites=TLS_RSA_WITH_AES_256_CBC_SHA
  89. # supported curve perference settings
  90. #
  91. # curves implemented in golang:
  92. # CurveP256
  93. # CurveP384
  94. # CurveP521
  95. #
  96. # Note:
  97. # - Do not use CurveP384/CurveP521 which is with poor performance
  98. #
  99. curvePreferences=CurveP256
  100. # support Sslv2 ClientHello for compatible with ancient
  101. # TLS capable clients (mozilla 5, java 5/6, openssl 0.9.8 etc)
  102. enableSslv2ClientHello = true
  103. # client ca certificates base directory
  104. # Note: filename suffix for ca certificate file should be ".crt", eg. example_ca_bundle.crt
  105. clientCABaseDir = tls_conf/client_ca
  106. [sessionCache]
  107. # disable tls session cache or not
  108. sessionCacheDisabled = true
  109. # tcp address of redis server
  110. servers = "example.redis.cluster"
  111. # prefix for cache key
  112. keyPrefix = "bfe"
  113. # connection params (ms)
  114. connectTimeout = 50
  115. readTimeout = 50
  116. writeTimeout = 50
  117. # max idle connections in connection pool
  118. maxIdle = 20
  119. # expire time for tls session state (second)
  120. sessionExpire = 3600
  121. [sessionTicket]
  122. # disable tls session ticket or not
  123. sessionTicketsDisabled = true
  124. # session ticket key
  125. sessionTicketKeyFile = tls_conf/session_ticket_key.data