百度智能云

All Product Document

          Load Balance

          Custom Configuration

          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

          1. Log in to the Baidu AI Cloud platform, select “Product Service > BLB”, and click the BLB name to enter the instance details page.
          2. Click "Monitor Settings" in the left navigation bar and select HTTP or HTTPS protocol to configure 7-Layer monitoring.
          3. Enable the custom configuration button and add the custom configuration.

          1610452535984.png

          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
        • ON means that the response from the back-end server is cached. BLB caches the response and returns it to the back-end server after all responses are received.
        • OFF means that the response from the back-end server is not cached.
          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
        • X-BLB-Cport $cport
        • X-BLB-Vip $vip
        • X-BLB-Request-Id $bce_blb_request_id
        • X-BLB-Client-Cert $ssl_client_cert
        • None The request header passed to the backend:
        • client port,
        • BLB’s Vip,
        • Unique request ID
        • , client certificate for HTTPS request (only HTTPS monitoring takes effect)
        • 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
          Previous
          Access Control
          Next
          API Reference