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¶
- You must have a domain configured on Nitrogen.
Steps¶
-
Click on
Settingsmenu, and openHeader Conditionstab.

-
Click on
Createbutton.
You will now be taken to a screen to provide header details.-
Group Name: Provide short name about the cookie condition you are creating. For now, putBotshere. Note: Please keep the name meaningful and relevant. -
Header Name: Enter the request-header name. We will be puttinguser-agenthere -
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.

-
-
Click on
Savebutton. The configured pattern will be showed inHeader conditionslist.
You can now use this condition at many places such as rewrite/caching/blocking rules.
Notes¶
- A Header conditions group that is currently in use cannot be edited. To make changes, you can either:
- Delete the rule that is using the Header conditions group, or
- Clone the existing group and create a new Header conditions group to use in your rules.