I have GeoIP working on my sites in the actual pages, I have enabled it my nginx.conf file
http {
set_real_ip_from 127.0.0.1;
real_ip_header X-Forwarded-For;
# GEO
geoip_country /etc/nginx/geoip/GeoIP.dat;
geoip_city /etc/nginx/geoip/GeoLiteCity.dat;
}
Defined in my fastcgi_params
fastcgi_param GEOIP_COUNTRY_CODE $geoip_country_code;
fastcgi_param GEOIP_COUNTRY_CODE3 $geoip_country_code3;
fastcgi_param GEOIP_COUNTRY_NAME $geoip_country_name;
fastcgi_param GEOIP_CITY_COUNTRY_CODE $geoip_city_country_code;
fastcgi_param GEOIP_CITY_COUNTRY_CODE3 $geoip_city_country_code3;
fastcgi_param GEOIP_CITY_COUNTRY_NAME $geoip_city_country_name;
fastcgi_param GEOIP_REGION $geoip_region;
fastcgi_param GEOIP_CITY $geoip_city;
fastcgi_param GEOIP_POSTAL_CODE $geoip_postal_code;
fastcgi_param GEOIP_CITY_CONTINENT_CODE $geoip_city_continent_code;
fastcgi_param GEOIP_LATITUDE $geoip_latitude;
fastcgi_param GEOIP_LONGITUDE $geoip_longitude;
What I am trying to do but can't figure out how to with NGINX is to catch any incoming hit to the server regardless of the domain or subdomain to redirect to a specific link. I have been trying what I can find online, which most point to using, if's which from my understanding should be avoided. So I am trying to sort out the actual proper method. I have Varnish on my front end
So say someone from Germany hits the server, I want NGINX to be able to catch the request and redirect to a specific page all the rest work as normal. I am thinking if I add something after my define in http in the nginx.conf file would be the best place to catch it.
Thank you for any help on this and if I need to post more about my config let me know.