> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.jboard.io/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to Block or Allow Traffic by Country in Cloudflare?

If you want to restrict access to your job board based on a visitor’s country—either to allow only traffic from specific countries or to block unwanted regions—Cloudflare provides an easy way to do this through its Web Application Firewall.

||| Important: Your domain must be connected to and proxied through Cloudflare for this to work. If you haven’t done this yet, follow this guide on [Setting Up Cloudflare for Your Job Board’s Domain](/en/article/setting-up-cloudflare-for-your-job-boards-domain-67d2yf/)

### Step 1: Log in to Your Cloudflare Dashboard

1. Go to https://dash.cloudflare.com
2. Select the domain you want to configure.

### Step 2: Navigate to Security Rules

1. In the left-hand sidebar, go to **Security > WAF**.
2. Click on the **Custom Rules** tab.
3. Click **Create Rule**.

![Creating Custom Rule On Cloudflare](https://storage.crisp.chat/users/helpdesk/website/-/8/0/3/0/8030a322aa1b180/2025-05-1415-01_1vku2ws.png)

### Step 3: Create a Country-Based Rule
Before setting up your rule, you’ll need the **2-letter ISO country codes** for the countries you want to block or allow.

You can find the full list here: [ISO 3166 Country Codes (Wikipedia)](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes)

###### Option A: Block Traffic from Specific Countries

1. Rule Name: Enter a descriptive name like **Block Traffic from Canada**.
2. Expression Editor: Click **Edit expression** and paste the following (replacing the country codes as needed):

`ip.geoip.country in {"CA"}`

3. **Actions**: From the dropdown, select **Block**.
4. Click **Deploy** to activate the rule.

![](https://storage.crisp.chat/users/helpdesk/website/-/8/0/3/0/8030a322aa1b180/2025-05-1415-37_1qsx54h.png)

###### Option B: Allow Only Traffic from Specific Countries

1. Rule Name: Enter a descriptive name like **Allow Only US and UK**.
2. Expression Editor: Click **Edit expression** and paste:

`not ip.geoip.country in {"US" "GB"}`

3. **Action**: Select **Block**—this blocks all countries not listed.
4. Click **Deploy**.

![](https://storage.crisp.chat/users/helpdesk/website/-/8/0/3/0/8030a322aa1b180/2025-05-1415-41_mviupq.png)