0

I am trying to redirect visitors based on two conditions, one based on the continent, and then based on their country, here are the current maps that I came up with eventually:

## GeoIP Redirection
map $geoip_city_continent_code $closest_server {
  default row.example.com;
  EU      www.example.com;
  NA      us.example.com;
}
map $geoip_city_country_code $closest_server {
  CH      ch.example.com;
}

But this did not work, for this I am trying to understand what is the best approach to achieve this. Any help appreciated.

Ibrahim S
  • 11
  • 1
  • 3

2 Answers2

0

this is not related to your issue, but I think is better to redirect the users to the closest server, using geodns, in this way you don't have the tcp handshake, because dns client use udp

c4f4t0r
  • 5,301
  • 3
  • 31
  • 42
-1

For each of those subdomains, add an A record in your DNS configuration with the IP of the server for that region:

EU      www.example.com - 1.1.1.2
NA      us.example.com  - 1.1.1.3