Updated on 2024-09-19 GMT+08:00

Forwarding Custom Header Fields

This topic describes how to use WAF to insert additional header fields into website requests. For example, you can insert the $request_id field into the request header to identify the request throughout the entire link.

Prerequisites

You have added the website you want to protect to WAF in Cloud Mode - CNAME or Dedicated Mode.

Constraints

  • Header field forwarding can be configured only when you select Cloud Mode - CNAME and Dedicated Mode.
  • Forwarding custom header fields is supported in some regions. For details, see Functions.
  • You can configure up to eight key/value pairs.
  • The value can be set to a custom string or a variable starting with $. Variables starting with $ support only the following fields:
    $time_local
    $request_id
    $connection_requests
    $tenant_id
    $project_id
    $remote_addr
    $remote_port
    $scheme
    $request_method
    $http_host
    $origin_uri
    $request_length
    $ssl_server_name
    $ssl_protocol
    $ssl_curves
    $ssl_session_reused

Forwarding Custom Header Fields

  1. Log in to the management console.
  2. Click in the upper left corner of the management console and select a region or project.
  3. Click in the upper left corner and choose Web Application Firewall under Security & Compliance.
  4. In the navigation pane on the left, choose Website Settings.
  5. In the Domain Name column, click the website domain name to go to the basic information page.
  6. In the Forward Field column, click . In the displayed Forward Field dialog box, enter a key/value pair. To add more fields, click Add.

    Figure 1 Forward Field

  7. After the fields are added, click Confirm.