There's an nginx with the geoip2 module set up.
geoip2 /var/lib/GeoIP/GeoLite2-Country.mmdb {
auto_reload 24h;
$geoip2_country default=XX country iso_code;
$geoip2_country_name country names en;
}
It receives traffic from Cloudflare, and real_ip is configured.
However, in X_GEOIP2_COUNTRY_NAME, the country is correct, but in X_GEOIP2_COUNTRY_CODE, it's not (it shows the country of Cloudflare)."

#> mmdblookup --file /var/lib/GeoIP/GeoLite2-Country.mmdb --ip 212.7.1.5 country iso_code
"EE" <utf8_string>
#> mmdblookup --file /var/lib/GeoIP/GeoLite2-Country.mmdb --ip 212.7.1.5 country names en
"Estonia" <utf8_string>