-
-
Save johnsonc/386650c151185fecce4b19ed8eaba572 to your computer and use it in GitHub Desktop.
nginx - pass GEOIP headers to proxy host
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http block | |
geoip_city /usr/local/share/GeoIP/GeoIPCity.dat; | |
geoip_country /usr/local/share/GeoIP/GeoIPCountry.dat; | |
# location block | |
proxy_set_header GEOIP_COUNTRY_CODE $geoip_country_code; | |
proxy_set_header GEOIP_COUNTRY_CODE3 $geoip_country_code3; | |
proxy_set_header GEOIP_COUNTRY_NAME $geoip_country_name; | |
proxy_set_header GEOIP_CITY_COUNTRY_CODE $geoip_city_country_code; | |
proxy_set_header GEOIP_CITY_COUNTRY_CODE3 $geoip_city_country_code3; | |
proxy_set_header GEOIP_CITY_COUNTRY_NAME $geoip_city_country_name; | |
proxy_set_header GEOIP_REGION $geoip_region; | |
proxy_set_header GEOIP_CITY $geoip_city; | |
proxy_set_header GEOIP_POSTAL_CODE $geoip_postal_code; | |
proxy_set_header GEOIP_CITY_CONTINENT_CODE $geoip_city_continent_code; | |
proxy_set_header GEOIP_LATITUDE $geoip_latitude; | |
proxy_set_header GEOIP_LONGITUDE $geoip_longitude; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment