Skip to content

Header conditions

This page will show you steps to configure header based condition. These then can be used at multiple places such as rewrite/caching/blocking rules.

Typical use-case is, you would want to pass all requests from bots to https://prerender.io/.
Here, we can achieve it by identifying all Bot requests by value of user-agent request header.

Note: Header conditions will work only on request-headers.
For demo purpose, we will be using www.nviztest.com domain as an example. Here, we will only be using googlebot and bingbot user-agent for simplicity.

Prerequisite

  1. You must have a domain configured on Nitrogen.

Steps

  1. Click on Settings menu, and open Header Conditions tab.
    Step

  2. Click on Create button.
    You will now be taken to a screen to provide header details.

    1. Group Name: Provide short name about the cookie condition you are creating.
      For now, put Bots here. Note: Please keep the name meaningful and relevant.

    2. Header Name: Enter the request-header name.
      We will be putting user-agent here

    3. Header value: Put a regex expression here that will be matched against incoming request's user-agent header's value.
      For now, put .*(googlebot|bingbot).* here
      Note: By default header value match is case-insensitive.
      Step

  3. Click on Save button. The configured pattern will be showed in Header conditions list.

You can now use this condition at many places such as rewrite/caching/blocking rules.

Notes