Forum: NGINX nginx-0.7.23

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2008-11-27 14:20
(Received via mailing list)
Changes with nginx 0.7.23                                        27 Nov
2008

    *) Feature: the "delete" and "ranges" parameters in the "geo"
directive.

    *) Feature: speeding up loading of geo base with large number of
values.

    *) Feature: decrease of memory required for geo base load.
49d68f4402d8f4eba3d3c373d89d1913?d=identicon&s=25 lhmwzy (Guest)
on 2008-11-27 14:44
(Received via mailing list)
Great!TKS!

2008/11/27 Igor Sysoev <is@rambler-co.ru>:
49d68f4402d8f4eba3d3c373d89d1913?d=identicon&s=25 lhmwzy (Guest)
on 2008-11-27 14:48
(Received via mailing list)
When will ngx_http_secure_link_module add "timeout" directive,so the
uri will valid after the "timeout"?
E103965e6ef5247c374b2cb282eff010?d=identicon&s=25 Bobby Dr (bobby)
on 2008-11-28 18:45
Good job! Thanks!
Can we use geoip City database with this release? Is there any script to
convert the CSV files to a CIDR (nginx-compatible) file?
Thanks again.
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2008-11-28 21:59
(Received via mailing list)
On Fri, Nov 28, 2008 at 06:45:16PM +0100, Bobby Dr wrote:

> Good job! Thanks!
> Can we use geoip City database with this release? Is there any script to
> convert the CSV files to a CIDR (nginx-compatible) file?

I'm using this perl script to convert to CIDR format:
---------------------
#!/usr/bin/perl -w

use Net::CIDR::Lite;
use strict;
use warnings;

while (<>) {

    if (/^"([^"]+)","([^"]+)","([^"]+)"/){

        my($start, $end, $region) = ($1, $2, $3);

        my $cidr = Net::CIDR::Lite->new(ip($start) . "-" . ip($end));

        print((join " $region;\n", $cidr->list), " $region;\n");
    }
}


sub ip {
    my $n = shift;

    return (($n >> 24) & 0xff) . "." .
           (($n >> 16) & 0xff) . "." .
            (($n >> 8) & 0xff) . "." .
                   ($n & 0xff);
}
---------------------

You should change the line

-       print((join " $region;\n", $cidr->list), " $region;\n");
+       print((join " $region;\n", $cidr->list_range), " $region;\n");

to use ranges format instead of CIDR.

The ranges can be used as

geo $geo {
    ranges;
    default   0;
    include   geoip.conf;
}
E103965e6ef5247c374b2cb282eff010?d=identicon&s=25 Bobby Dr (bobby)
on 2008-11-29 05:51
Igor Sysoev wrote:
> I'm using this perl script to convert to CIDR format:

Wow! That was fast! Thanks for the script.

I am running the 0.6.x stable version. Is the new 0.7.23 geo module
backwards compatible? (i.e. is it safe to replace the old module with
the new one for use with the stable version?)
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2008-11-29 10:21
(Received via mailing list)
On Sat, Nov 29, 2008 at 05:51:42AM +0100, Bobby Dr wrote:

> Igor Sysoev wrote:
> > I'm using this perl script to convert to CIDR format:
>
> Wow! That was fast! Thanks for the script.
>
> I am running the 0.6.x stable version. Is the new 0.7.23 geo module
> backwards compatible? (i.e. is it safe to replace the old module with
> the new one for use with the stable version?)

Yes, it's backward compatible.
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2008-11-29 10:33
(Received via mailing list)
On Sat, Nov 29, 2008 at 12:06:43PM +0300, Igor Sysoev wrote:

>
> Yes, it's backward compatible.

Sorry, I meant that 0.7 geo module is backward compatible in
configuration.
However, you can not place the module in 0.6 source tree.
This topic is locked and can not be replied to.