Nginx – Lightest IP geolocation technology for static site

geolocationnginxreverse-proxysquidvarnish

I run a site that is behind a Squid reverse proxy which delivers most of the content cached (including html, not only images, etc.). I need to show a different content for our users located in the US. In order to do that, what solutions do we have?

I thought about using some geo dns service like edgedirector.com and move the American users to a different IP but I have serious doubts about geo DNS solutions. I understand that the edgedirector can only know the location of the ISP's DNS server (or OpenDNS, Google Public DNS, etc.) used by the client but not the client's location. I do not really understand how can they know the IP of the client, teorically the client do not need to query directly edgedirector.

Another solution I thought was using javascript and MaxMind GeoIP Javascript Web Service or Google API client location but that would be too slow.

I also thought about using some reverse proxy like Squid, Varnish, Ngninx, etc. which works directly with Maxmind software (or other software) without the need to go to the backend (like for example a cached copy for each country). Do not know if that is possible with Squid or with some other reverse proxy.

Best Answer

If two users one US and the other non US request for the same file static.html and you want to show a different version to each of them then squid will not help.You can use MaxMind's GeoIP with nginx.

http://wiki.nginx.org/HttpGeoIPModule

Related Topic