1

I'm trying to return custom header with value GEOIP_COUNTRY_CODE from Maxmind module.

I've tried the following and nothing works

# MaxMind Requirements:
GeoIPEnable On
GeoIPScanProxyHeaders On
Header set anchorglobal-country-test "%{ENV:GEOIP_COUNTRY_CODE}e"
Header set anchorglobal-country "%{GEOIP_COUNTRY_CODE}e"

Please advise what's missing.

Thanks.

ronanray
  • 113
  • 1
  • 5
  • GEOIP_COUNTRY_CODE should be env variable, so you might need to set it first with SetEnv directive before setting the header "SetEnv MyGEOCODE %{GEOIP_COUNTRY_CODE}" Header set anchorglobal-country "%{MyGEOCODE}e" – Danila Ladner Dec 01 '17 at 13:20
  • also worth doublechecking- did the geoip service start successfully after installing it and restarting apache? [be sure you're running the right version for your Apache install too: https://dev.maxmind.com/geoip/legacy/mod_geoip2/ ] – Anson W Han Dec 03 '17 at 05:27
  • @AnsonWHan I can confirm that the module is installed properly as I have other sites with geo ip detection working properly. My only problem now is to get the country code returned as HTTP response header. – ronanray Dec 04 '17 at 10:44
  • 1
    @DanilaLadner I tried your suggestion and I got %{GEOIP_COUNTRY_CODE} printed as the header value. – ronanray Dec 04 '17 at 10:45

0 Answers0