| [ Web Proxy ] |
| Viewing: https://developers.cloudflare.com/waf/custom-rules/use-cases/allow-traffic-from-specific-countries/ | [Back] [Original] |
This example custom rule blocks requests based on country code using the ip.src.country field, only allowing requests from two countries: United States and Mexico.
When incoming requests match:
| Field | Operator | Value |
|---|---|---|
| Country | is not in | Mexico, United States |
If you are using the expression editor:
(not ip.src.country in {"US" "MX"})
Then take action: Block
| Web Proxy Viewer | New URL | Original Page |