ngx_http_geo_module range overlaps

Ксения Юрьевна Блащук ksyblast at gmail.com
Sat Jan 4 12:01:16 UTC 2014


Добрый день.
Возник вопрос по модулю ngx_http_geo_module. Почему-то нельзя внести
пересекающиеся диапазоны адресов. В документации:

A value of the most specific match is used. For example, for the 127.0.0.1
address the value "RU" will be chosen, not "US".

Example with ranges:

geo $country {
    ranges;
    default                   ZZ;
    127.0.0.0-127.0.0.0       US;
    127.0.0.1-127.0.0.1       RU;
    127.0.0.1-127.0.0.255     US;
    10.1.0.0-10.1.255.255     RU;
    192.168.1.0-192.168.1.255 UK;
}

Пытаюсь воспроизвести этот пример:

/etc/init.d/nginx reload
 * Checking nginx' configuration ...
nginx: [emerg] range "127.0.0.1-127.0.0.255" overlaps "127.0.0.1-127.0.0.1"
in /etc/nginx/sites/test-geo.conf:6
nginx: configuration file /etc/nginx/nginx.conf test failed
nginx: [emerg] range "127.0.0.1-127.0.0.255" overlaps "127.0.0.1-127.0.0.1"
in /etc/nginx/sites/test-geo.conf:6
nginx: configuration file /etc/nginx/nginx.conf test failed

/etc/nginx/sites/test-geo.conf:
geo $country {
    ranges;
    default                   ZZ;
    127.0.0.0-127.0.0.0       US;
    127.0.0.1-127.0.0.1       RU;
    127.0.0.1-127.0.0.255     US;
    10.1.0.0-10.1.255.255     RU;
    192.168.1.0-192.168.1.255 UK;
}

 nginx -V
nginx version: nginx/1.4.4
configure arguments: --prefix=/usr --conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error_log --pid-path=/run/nginx.pid
--lock-path=/run/lock/nginx.lock --with-cc-opt=-I/usr/include
--with-ld-opt=-L/usr/lib --http-log-path=/var/log/nginx/access_log
--http-client-body-temp-path=//var/lib/nginx/tmp/client
--http-proxy-temp-path=//var/lib/nginx/tmp/proxy
--http-fastcgi-temp-path=//var/lib/nginx/tmp/fastcgi
--http-scgi-temp-path=//var/lib/nginx/tmp/scgi
--http-uwsgi-temp-path=//var/lib/nginx/tmp/uwsgi --with-file-aio
--with-aio_module --with-pcre --with-pcre-jit
--without-http_empty_gif_module --without-http_fastcgi_module
--without-http_map_module --without-http_memcached_module
--without-http_scgi_module --without-http_split_clients_module
--without-http_uwsgi_module --with-http_addition_module
--with-http_image_filter_module --with-http_mp4_module
--with-http_realip_module --with-http_secure_link_module
--with-http_stub_status_module
--add-module=/var/tmp/portage/www-servers/nginx-1.4.4/work/headers-more-nginx-module-0.22
--add-module=/var/tmp/portage/www-servers/nginx-1.4.4/work/ngx-fancyindex-0.3.2
--without-mail_imap_module --without-mail_pop3_module
--without-mail_smtp_module --user=nginx --group=nginx

Gentoo Base System release 2.2
 uname -a
Linux 3.0.78 #1 SMP Mon May 20 15:17:58 FET 2013 x86_64 Intel(R) Xeon(R)
CPU E5310 @ 1.60GHz GenuineIntel GNU/Linux


В чем может быть дело?
Спасибо.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-ru/attachments/20140104/1dc28f4b/attachment.html>


Подробная информация о списке рассылки nginx-ru