I want to setup a webserver, where every HTTP request is directly redirected to a nearby mirror. So far we used the unfortunately no longer supported Perl module Apache2::Geo::IP
together with Apache's mod_perl
and the legacy Geo::IP
from MaxMind Inc.
The mirror list will change from time to time and uses the simple association between URL and the country of this server:
https://www1.crest.fr/archive/ fr
https://www2.uchile.cl/arcivo/ cl
https://www3.blurbs.cc/sammlung/ de
E. g. an user located in Chile will be redirected to https://www2.uchile.cl/arcivo/
etc.
A country may have more than one server, which all should be accessed, e.g. randomly or round-robin.
I'm looking for a solution with the GeoIP2 country databases which can run behind a reverse proxy (the old solution did not). What's the recommended way to achieve this?