Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to provide different webpage experiences based on geographies divided as Western, Asian, African audience etc.

I plan to do this with Nginx geo module by segmenting ip addresses and routing to the webserver with headers set from the Nginx reverse proxy

Now, where can I get the list of ipaddress blocks that can tell me if a user is from a e.g: western country, Asian etc?

Which is the canonical source to get this?

share|improve this question
    
possible duplicate of Best way to block a country by IP address? –  Michael Hampton Sep 10 '12 at 23:07
    
It isn't a duplicate. That is about blocking access to specific countries, whereas this is about providing differing content based on country. They are related, but not exact duplicates, and there aren't many good answers to the suggested duplicate either. –  dunxd Sep 12 '12 at 13:44
add comment

1 Answer

Did you see this page about Creating geo.conf From MaxMind GeoIP Country Database? It's linked from the bottom of the nginx Geo Module you mentioned.

You will have to divide the countries up into categories (Western, Asian, African audience etc.) yourself but that shouldn't be too difficult.

If it were me doing this, I would do it in the app using one of the APIs that MaxMind provide with the actual data or pushing the data from the CSV file into my database. Don't forget that there are functions available to convert IP addresses from dotted-quad to numerical formats and back (ip2long(), INET_NTOA(), etc.) so you don't have to use the sample code given there.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.