I'm out of ideas to solve the following issue:
I use GeoIP with nginx
server. I installed the module and I have the following under http
context in nginx.conf
:
geoip2 /usr/share/GeoIP/GeoLite2-Country.mmdb {
$geoip2_data_country_code default=NA country iso_code;
$geoip2_data_country_name default=NA country names en;
$geoip2_data_city_name default=NA city names en;
}
geoip2 /usr/share/GeoIP/GeoLite2-City.mmdb {
$geoip2_data_city_name default=NA city names en;
$geoip2_data_state_name default=NA subdivisions 0 names en;
$geoip2_data_state_code default=NA subdivisions 0 iso_code;
}
I use geoip2
variables to create another header (using map directive), like so:
map $geoip2_city_name $city_code {
default "NA/LIST";
"Dusseldorf" "025633";
"Munster" "048633";
.....
}
The problem I have is that even in English GeoIP gives me special chars such as ä, æ, ü, ö, ï...
,
and the map list don't have those values (I can't change the list).
So My question is how can I "force/change" the variable geoip2_city_name
to use utf-8 characters? Example:
Düsseldorf => Dusseldorf
Mönchengladbach => Monchengladbach
Würzburg => Wurzburg
I have tried to set:
charset utf-8;
source_charset utf-8;
On http context but didn't worked.
Thank you add in advance!
I have tried to use chatsets directives inside http context, and expected the change from special chars to utf-8.