Airlock as a Service Knowledge Base

Header rewrites

The Header rewrites page allows you to configure rules that modify HTTP request and response headers for the selected tenant. Use these rules to add custom headers or control which headers are forwarded to back-end applications or clients.

Header rewrite rules can optionally be restricted to requests that match specific conditions.

Header rewrite rules

The Header rewrite rules table lists the configured header rewrite rules for the selected tenant.

For each rule, the table shows:

  • Rule name – name of the rule.

  • Module – application module to which the rule applies.

  • Target – whether the rule applies to request or response headers.

  • Headers – headers and matching criteria configured for the rule.

  • Conditions – request conditions that determine when the rule applies.

  • Action – whether the rule adds or allows headers.

Use the Module and Target filters to narrow down the displayed rules. Click Rule name to sort the rules by name.

Use the menu icon (⋮) of an existing rule to edit, duplicate, or delete it.

Add a header rewrite rule

  1. Click ⨁ Add new rule.
    ➔ The Add new rule dialog opens.

  2. Configure the following settings:

    • Rule name: Enter a name that identifies the rule.

    • Module: Select the application module to which the rule applies:

      • Loginapp

      • Adminapp

      • Transaction approval

    • Target: Select which headers the rule applies to:

      • Request: Modify headers before forwarding requests to the back-end application.

      • Response: Modify headers before forwarding responses to the client.

    • Mode: Select the type of header modification:

      • Add header: Add HTTP headers to requests or responses according to the selected header addition strategy.

      • Allow header: Specify which HTTP headers are allowed to pass through. Headers that are not on the allow list are dropped.

    • Protocol: Select the network protocol to use.

    • App protocol: For TCP connect

  3. Configure the additional settings for the selected mode as described below.

Add header

When Add header is selected, configure the following settings:

  • Header addition strategy: Select how existing headers are handled:

    • Add if absent: Add the specified header only if it does not already exist.

    • Overwrite or add: Overwrite the existing header value if the header is present, or add the header if it is absent.

  • Headers: Specify the headers to add:

    • Name: Enter the name of the HTTP header, for example, X-Custom-Header.

    • Value: Enter the value to assign to the header.

Click Add header to configure additional headers. Use the delete icon next to a header to remove it from the rule.

Allow header

When Allow header is selected, configure the headers that are permitted to pass through.

Under Headers, specify the following settings:

  • Name:

    • Specify a header name and select a matching operator.

    • Leave the input ield empty to allow any header name whose value matches the configured value condition.

  • Value:

    • Specify a header value and select a matching operator.

    • Leave the input field empty to allow the matching header regardless of its value.

    • Use the Aa button next to the input field to switch between case-sensitive and case-insensitive matching.

The following matching operators are available:

  • equals: Matches the specified string exactly.

  • starts with: Matches strings that begin with the specified string.

  • ends with: Matches strings that end with the specified string.

  • contains: Matches strings containing the specified string.

  • matches regex: Matches strings against the specified regex.

Click Add header to configure additional allowed headers. Use the delete icon (🗑︎) next to a header to remove it from the rule.

Conditions

By default, a header rewrite rule applies to every request.

To restrict the rule to specific requests:

  1. Select Set conditions to requests.

  2. Under Apply condition to, select how the configured conditions are evaluated:

    • Matching requests: Apply the rule to requests that meet every configured condition.

    • Not matching requests: Apply the rule to requests that do not meet at least one configured condition.

  3. Under Condition options, select and configure one or more of the following conditions:

    • Methods:
      Under Matching methods, select the HTTP request methods to match.

    • Path:
      Under Matching path, select a matching operator* and enter the request path to match. Use the Aa button to switch between case-sensitive and case-insensitive matching.

    • Media type:
      Under Matching media type, select a matching operator* and enter the request's media type to match, for example, application/json.

    • Header: Configure the following properties to match HTTP request headers:

      • Header name: Select a matching operator* and enter the header name to match. Leave the field empty to match any header whose value matches the configured value condition.

      • Header value: Select a matching operator* and enter the header value to match. Leave the field empty to match the header by name only.

    • Remote IP:

      • Under Apply condition to, select how the configured IP ranges are evaluated:

        • Matching remote IPs: Match requests originating from IP addresses within the specified CIDR ranges.

        • Not matching remote IPs: Match requests originating from IP addresses outside the specified CIDR ranges.

      • Under CIDR ranges, enter the IP address ranges in CIDR notation, for example, 192.0.2.0/24. Click Add CIDR range to specify additional ranges. Use the delete icon next to a range to remove it.

If no conditions are configured, the rule applies to every request.

* For descriptions of the available matching operators, see Allow header.

Save the rule

After configuring the headers and any optional conditions, click Save.

The new rule is added to the Header rewrite rules table.

Manage existing header rewrite rules

Use the action menu (⋮) of a rule in the Header rewrite rules table to manage it.

The following actions are available:

  • Edit rule: Modify the configuration of an existing rule. Save your changes when finished.

  • Duplicate rule: Create a copy of an existing rule.

  • Delete rule: Remove a rule that is no longer required.