I believe the following will work.
when HTTP_REQUEST priority 500 {
# Define the URI to be protected
set protected_uri "/uri"
# Define the allowed Country
set allowed_country "SA"
# Get the country code from the client's IP address
set client_ip [IP::client_addr]
set client_country [whereis $client_ip country]
# check if the URI matches and if the country is allowed
if { (([HTTPS::uri] equals ${protected_uri}) && (${client_country} != ${allowed_country})) } {
# Send a 403 Forbidden response
HTTP::respond 403 content "Access denied"
}
}