Skip to content

Content blocks

Follow these steps to configure conditional blocking. i.e. to block the requests based on conditions.
Typical use-cases are:

  • block malicious request URLs.
  • block the IPs you found making malicious requests.
  • block requests coming from certain bots.
  • block requests coming from certain countries.

Note: For demo purpose, we will be using www.nviztest.com domain as an example.
Here, we will be blocking a certain set of IPs.

Prerequisite

  1. You must have a domain configured on Nitrogen.
  2. For this example to work, you should have created an IP based condition. If not, you can refer this article for the same.

Steps

  1. Click on Security menu, then select Content Blocks tab. Select appropriate domain from the domains dropdown. Step

  2. Click on Add New button at top right corner. You will be taken to a screen to provide details about block conditions.
    Provide the required details:

    1. Comment: Provide short detail about the caching pattern/rule. Enter Vary wordpress admin and normal user for example.
      Note: Please keep the comment meaningful and relevant.

    2. If: Here we will be specifying what to be added to cache-key when the condition matches.

      1. Pattern Type: We can configure block based on multiple conditions.
        e.g. URL-pattern, HTTP-method, request-header, cookie, request-user's origin-country, request-IP, request-user's device-type, request's user-agent
        Select IP for now.

      2. Check: Select either matches or not matches as per your requirement.
        We will select matches here.

      3. Condition Value: Select the condition pattern. Here, select IP Blocklist as per the example requirement.

    3. So now the condition for this blocking is Block any request > if it is from the IP > which is present in the given IP-Blocklist.
      Note: You can add multiple conditions as per your need, by clicking +And button.

    4. Click on Save button. The configured rule will be showed in Content Blocks list.

Notes

These changes will only take effect when deployed. Saving them will only be saving them in draft. Please refer documentation about Deploy process for it.