Custom configuration
BLB supports custom configuration function, allowing users to set parameters of BLB Layer 7 listener such as client_header_timeout, client_body_timeout, proxy_buffer_size, proxy_buffers and proxy_set_header, thus meeting user’s custom configuration needs.
Notes
- The count of personalized configurations in each region is not limited temporarily.
- Currently, one BLB instance can be bound to multiple personalized configurations, and one type of personalized configuration can be bound to multiple instances.
- Custom configurations are only applicable to Layer 7 HTTP/HTTPS listeners of the load balancer (previously known as the "application load balancer").
Add personalized configuration
- Log in to the Baidu AI Cloud Platform, go to Products & Services > Baidu Load Balance (BLB), and click on the BLB name to access the Instance Details page.
- Click "Listener Settings" in the left navigation bar, choose the HTTP or HTTPS protocol to set up a Layer 7 listener.
- Turn on the custom configuration switch and add the desired custom settings.

Configuration parameter description
The current BLB custom configuration supports the following fields:
| Configuration field | Parameter range | Default value | Configuration |
|---|---|---|---|
| client_header_timeout | 30-120 | 60s | The timeout duration (second) for reading the client request header. If the client does not send the complete request header within this time, BLB will terminate the request. |
| client_header_buffer_size | 1-16 | 1k | Buffer size (k) for storing client request headers |
| client_body_timeout | 30-120 | 60s | Timeout for reading client request body (in seconds): The timeout refers to the time interval between two successful read operations by BLB, not the total transfer time of the entire request body. If the client doesn't send data within this period, BLB will terminate the request. |
| proxy_buffer_size | 1-64 | 4k | BLB obtains the buffer size (in k) from the real server's response header. If the response header exceeds this size, BLB will reply with a 502 status. When using proxy_buffer_size, proxy_buffers must also be configured. |
| proxy_buffers | [3-8] [4-8] | 8 4k | BLB reads the buffer count and the size of each buffer (k) from the real server response body. |
| proxy_buffering | on,off | on | . You can also control the caching by adding X-Accel-Buffering in the response header. X-Accel-Buffering: yes means caching. X-Accel-Buffering: no means no caching |
| proxy_set_header | None | Request headers transferred to the real server |
|
| gzip_json | on,off | off |
Notes The configured values for proxy_buffer_size and proxy_buffers must satisfy the following constraints: 2 max (proxy_buffer_size, proxy_buffers.size) ≤ (proxy_buffers.num - 1) proxy_buffers.size. For example, if proxy_buffer_size is configured as 24k and proxy_buffers as 8 8k, then 2 24k = 48k and (8 - 1) 8k = 56k. In this case, 48k ≤ 56k. Thus, the configuration will not trigger errors; otherwise, it will.
Configuration code example:
1client_header_timeout:60
2client_body_timeout:60
3proxy_buffer_size:4
4proxy_buffers:8 4
5proxy_set_header:X-BLB-Cport $cport
