Custom Configuration
Last Updated:2022-01-14
BLB supports the custom configuration feature and allows users to set the configuration parameters for BLB layer-7 listening, such as client_header_timeout, client_body_timeout, proxy_buffer_size, proxy_buffers, and proxy_set_header, meeting their custom configuration requirements.
Add Custom Configuration
- Log in to the Baidu AI Cloud platform, select “Product Service > BLB”, and click the BLB name to enter the instance details page.
- Click "Monitor Settings" in the left navigation bar and select HTTP or HTTPS protocol to configure 7-Layer monitoring.
- Enable the custom configuration button and add the custom configuration.
Description of Configuration Parameters
The custom configuration of the current BLB supports the following fields:
Configuration Field | Parameter Range | Default Value | Configuration Description |
---|---|---|---|
client_header_timeout | 30*120 | 60s | The timeout duration (s) for reading the request header from the client. When the client fails to send the complete request header within this period, BLB interrupts the request. |
client_body_timeout | 30*120 | 60s | The timeout duration (s) for reading the request body from the client, which is the interval between two consecutive successful readings of the request body by the BLB, but is not the transmission time of the request body. When the client fails to send any data within this period, BLB will interrupt the request. |
proxy_buffer_size | 1*64 | 4k | The buffer size (k) for BLB to read the response header from the back-end server. When the response header from the back-end server is larger than this size, BLB will return 502. To use “proxy_buffer_size”, you must set “proxy_buffers”. |
proxy_buffers | [3-8] [4-8] | 8 4k | The number and size (k) of buffers for BLB to read response body from the back-end server |
proxy_buffering | on, off | on | BLB does not cache the response, which causes some performance pressure on the back-end server. You can also control whether the response is cached by adding X-Accel-Buffering in the response header. X-Accel-Buffering: Yes indicates the caching, X-Accel-Buffering: no indicates no cache exists. |
proxy_set_header | None | The request header passed to the backend: |
Example of configuration code:
client_header_timeout:60
client_body_timeout:60
proxy_buffer_size:4
proxy_buffers:8 4
proxy_set_header:X-BLB-Cport $cport