Block all countries except a few

( ne "BR") or ( ne "CA") or ( ne "DE") or ( ne "US") or ( ne "GB") or ( ne "AR") or ( ne "PT") or ( ne "CO")

Why the above expression is blocking those countries instead of allowing them?

I want to allow only specific countries to access my website, so I had a rule… country does not equal XX then block…

However it seems to be doing the inverse?

Since nothing on google was helping, I started doing this with nginx:

But I have no idea if that’s affect performance a lot…

Hi @vitor,

I would use something like (not in {"BR" "CA" "DE" "US" "GB" "AR" "PT" "CO"})

If you want to use your original format, I think you may need AND instead of OR.


This topic was automatically closed after 30 days. New replies are no longer allowed.