GeoIPCity with nginx

Arvind Jayaprakash work at anomalizer.net
Sun Nov 23 10:59:08 MSK 2008


Maxim Dounin wrote:
> On Sat, Nov 22, 2008 at 05:18:31PM +0100, Bobby Dr wrote:
>
>   
>> Hello list!
>>
>> I know Maxmind's GeoIP Country database can be used easily with nginx.
>> But what about their Geo-City database?
>>
>> The binary file is much smaller however.
>>     
> Theoretically it should be possible to collapse ip ranges to 
> optimal set of cidr's to make this usable with native nginx geo 
> module, but this isn't really easy task.
>   
I've written a geoip module from grounds up that operates on a CSV file.
Once you get down to city level or even ISP level IP searches, the
current approach of operating on netmaskable blocks takes up a lot of
memory. Trees seem to be a better option.
>> Is there any official/3rd party geo-city module for nginx?
>>     
>
> AFAIK, no.
>
>   

Unfortunately, my module is not something that I can release right away
since I store a lot of additional data against each IP range and my code
currently assumes those fields exist. I'll release a cleaner version
once I figure how to refactor the code.






More information about the nginx mailing list