I’not master but just trying to help you
for rist you must to know All of UK IP Address range before.
This just example only:
i make file uk_ip.conf and save on /usr/local/geoip/uk_ip.conf
on file uk_ip.conf put all uk ip address
192.168.1.0/24 uk;
172.168.0.0/24 uk;
and next… uk ip address
One more i want also to add us country ip address
i make file us_ip.conf and save on /usr/local/geoip/us_ip.conf
1.2.3.0/24 us;
2.2.3.0/24 us;
3.2.3.0/24 us;
and next… us ip address
And this file of nginx.conf you can see:
This just example only i say you must use your own skill to
configuration your own server
nginx Master configuration
user nobody;
error_log logs/error.log; #Number of worker you need
worker_processes 1;
geo $geo {
default default; // for default server
include /usr/local/geoip/uk_ip.conf; // if uk ip address comming
found
in this database
include /usr/local/geoip/us_ip.conf; // if us ip address comming
found
in this database
}
// Now you make first default server if that ip address comming no one
in your ip address database country
upstream default.webserver {
server default.server1.com weight=4;
server default.server2.com;
}
// you can see i’m put also option weight that configuration will send
80% of the request to default.server1.com
// and another 20% to default.server2.com