# How to Customize and Whitelist 7G and 8G WAF Rules in xCloud

> Learn how to customize and whitelist 7G and 8G WAF rules in xCloud Host to prevent false positives without reducing security.

xCloud’s 7G and 8G Web Application Firewalls automatically block malicious traffic to keep your website safe. They protect against attacks such as SQL injection, cross-site scripting (XSS), bad bots, and more. While doing this, they allow legitimate visitors to browse your site without interruption.

## **What Are 7G and 8G WAF?**

The 7G Firewall blocks bad bots, suspicious query strings, referrers, malformed requests, and unauthorized HTTP methods.

The 8G Firewall includes all of these protections. It also adds rules to block bad cookies, bad hosts, advanced bots, and remote code execution (RCE).

Both firewalls reduce server load by filtering harmful requests early, before they reach your site.

## **Why Whitelist Firewall Rules?**

Sometimes a firewall can block legitimate requests. This is called a false positive. It can cause errors such as 403 Forbidden during uploads, plugin updates, or when connecting to third-party services.

False positives often happen when:

-   A plugin or theme contains query strings that match firewall patterns
-   Trusted API calls are flagged as suspicious
-   Certain file types or URLs match default rules
-   Search engine or analytics bots are blocked

Whitelisting specific firewall rules allows safe requests to pass without turning off your firewall protection.

## **Steps to Whitelist 7G and 8G Rules for Your Website in xCloud**

xCloud allows you to whitelist specific 7G and 8G WAF rules in xCloud to fix false positives without turning off your firewall.Let us get started and learn how to whitelist 7G and 8G WAF rules right from the dashboard easily. 

_Note: Currently, 8G and 7G rule customization is only available for NGINX servers. We will add support for OLS servers in the future._

### **Step 1: Enable the Firewall**

Log in to your xCloud dashboard and open your site. In the site menu, go to **Security → Overview & Firewall**. In the **Security Settings** card, turn on **7G Firewall** or **8G Firewall** under **Firewall rules**, then click **Save Settings** in the bar at the bottom of the card.

![Firewall rules group with the 7G Firewall and 8G Firewall switches](/_landing/docs/whitelist-7g-and-8g-waf-rules-in-xcloud-firewall-rules.png)

### **Step 2: Find Which Rules Are Blocking Legitimate Requests**

First, go to **Site Monitoring → Logs** (**Monitoring → Logs** on non-WordPress sites). Select the **8G Error Log** (or **7G Error Log**). These logs exist on Nginx sites only, and each one is listed only while its firewall is on. You can also click **View Logs** under the firewall option on **Security → Overview & Firewall**. Every entry is a request the firewall blocked. The **rule** column shows the rule that matched, for example `bad_request_6`.

The part before the number (for example, bad\_querystring) is the rule name you will use when creating your whitelist.

![8G Error Log selected on the Logs page, with the blocked requests and the rule that matched each one](/_landing/docs/whitelist-7g-and-8g-waf-rules-in-xcloud-8g-error-log.png)

### **Construct the Trigger and Drop Variable Names**

When the firewall blocks a request, it uses a **trigger variable** to identify which specific rule has matched.

The trigger variable follows these formats:

-   **7G Trigger Variable:** $<rule\_name>\_7g
-   **8G Trigger Variable:** $<rule\_name>\_8g

![Whitelist 7G and 8G WAF Rules](/_landing/docs/whitelist-7g-and-8g-waf-rules-in-xcloud-image-7.png)

To whitelist a rule, you must set its **drop variable** to 0. The drop variable follows these formats:

-   **7G Drop Variable:** $7g\_drop\_<rule\_name>
-   **8G Drop Variable:** $8g\_drop\_<rule\_name>

For example, if the triggered rule is bad\_request\_6

-   For **7G**, the drop variable will be:

Copy

1

2

```
set $7g_drop_bad_request 0;
```

-   For **8G**, the drop variable will be:

Copy

1

2

```
set $8g_drop_bad_request 0;
```

**Special Case for bad\_querystring:  
**For rules that start with bad\_querystring, the drop variable name changes slightly. In the drop variable, the term **bad\_querystring** is written as **bad\_query\_string** (with an extra underscore).

-   For **7G**, the drop variable will be:

Copy

1

```
set $7g_drop_bad_query_string 0;
```

-   For **8G**, the drop variable will be:

Copy

1

```
set $8g_drop_bad_query_string 0;
```

## **Step 4: Whitelist Rules via xCloud Custom NGINX (For Sites)**

To whitelist a firewall rule, go to **Tools → Nginx Customization** in your site menu. Nginx Customization stays under **Tools**; it did not move to the **Security** menu. Then, click **‘Add a New Config’**. Enter the whitelist rule using NGINX syntax.

Once you click on the **‘Add a New Config’,** a pop-up interface will appear. First, **‘Select Config Type’** and choose **‘8G Block’** from the dropdown (or **‘7G Block’** if the site uses the 7G Firewall; each type is listed only while that firewall is on), then give it a **‘Config File Name’**. After that, write the whitelisting rule inside the **‘Config Content’** field and click on the ‘**Run & Debug’**.

![](/_landing/docs/whitelist-7g-and-8g-waf-rules-in-xcloud-screen-shot-2025-08-26-at-10.48.22.png)

### **Example: Whitelist bad\_request\_6 in 7G or 8G**

If your log shows a rule like bad\_request\_6, you will need to whitelist it by disabling its drop variable.

Copy

1

2

3

4

5

```
if ($bad_request_8g = 1) {

    set $8g_drop_bad_request 0;

}
```

_**Note:** If you are using the 7G Firewall, replace 8g with 7g in the variable names, for example `$bad_request_7g` and `$7g_drop_bad_request`._

### **Example: Whitelist bad\_querystring in 7G** **or 8G**

Copy

1

2

3

4

5

```
if ($bad_querystring_8g = 1) {

    set $8g_drop_bad_query_string 0;

}
```

_**Note:** If you are using the 7G Firewall, replace 8g with 7g in the variable names, for example `$bad_querystring_7g` and `$7g_drop_bad_query_string`._

### **Example: Whitelist by IP Address**

Copy

1

2

3

4

5

6

7

8

9

10

11

12

13

14

```
if ($remote_addr = "199.191.137.17") {

    set $8g_drop_bad_request 0;

    set $8g_drop_bad_referer 0;

    set $8g_drop_bad_query_string 0;

    set $8g_drop_bad_method 0;

    set $8g_drop_bad_bot 0;

}
```

### **Example: Whitelist Plugin Requests by URI**

Copy

1

2

3

4

5

6

7

8

9

10

11

12

13

```
if ($request_uri ~* "essential-blocks") {

    set $8g_drop_bad_request 0;

    set $8g_drop_bad_referer 0;

    set $8g_drop_bad_query_string 0;

    set $8g_drop_bad_method 0;

    set $8g_drop_bad_bot 0;

}
```

_Note: If using the 8G Firewall, replace $7g\_ with $8g\_ in all variables._

### **Step 5: Save and Test**

After adding your whitelist rules, save the configuration. Test your website to confirm the false positives are resolved.

## **Server-Wide Whitelisting (Advanced)**

You can apply whitelist rules to all websites on the server by editing the firewall configuration files via SSH.

The file locations are:

-   **7G:** /etc/nginx/xcloud-conf/7g/server-conf/
-   **8G:** /etc/nginx/xcloud-conf/8g/server-conf/

After making changes, run nginx -t to test the configuration. Then reload NGINX with the service nginx reload.

This method affects all hosted sites and should be tested carefully. By following these steps, you can fine-tune your firewall to block real threats while preventing disruptions from false positives.

Still stuck? Contact our [**dedicated support team**](/docs/access-built-in-support-portal-in-xcloud/) for any of your queries.
