Updated on 2024-03-14 GMT+08:00

Forwarding Custom Header Fields

You can use WAF to add additional header information, for example, $request_id, to associate requests on the entire link. You can follow this topic to let WAF insert additional fields into a header and forward requests to origin servers.

Prerequisites

The website to be protected has been added to WAF.

Constraints

  • You can configure up to eight key/value pairs.
  • The key value can be set to any value other than keys in native Nginx fields.
  • 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

Procedure

  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.
  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.
  7. After the fields are added, click Confirm.