geo whitelist для limit_conn

Aleksandr Sytar sytar.alex at gmail.com
Wed Sep 19 12:01:18 UTC 2012


Добрый день,

Решил для создания белого списка адресов к которым применяется
limit_conn использовать geo модуль, как-то так:

geo  $conn_perserver {
		default          32;    # 32
		127.0.0.0.1     -;    # no limit
}

и далее:

limit_conn perip $conn_perserver;

Однако, на стадии тестирования конфига nginx рапортует:

C:\nginx>nginx.exe -t
nginx: [emerg] invalid number of connections "$conn_perip" in C:\nginx/conf/ngin
x.conf:76
nginx: configuration file C:\nginx/conf/nginx.conf test failed

C:\nginx>nginx.exe -V
nginx version: nginx/1.2.1
TLS SNI support enabled
configure arguments: --with-cc=cl --builddir=objs.msvc8 --with-debug --prefix= -
-conf-path=conf/nginx.conf --pid-path=logs/nginx.pid --http-log-path=logs/access
.log --error-log-path=logs/error.log --sbin-path=nginx.exe --http-client-body-te
mp-path=temp/client_body_temp --http-proxy-temp-path=temp/proxy_temp --http-fast
cgi-temp-path=temp/fastcgi_temp --http-scgi-temp-path=temp/scgi_temp --http-uwsg
i-temp-path=temp/uwsgi_temp --with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=objs.msv
c8/lib/pcre-8.30 --with-zlib=objs.msvc8/lib/zlib-1.2.5 --with-select_module --wi
th-http_realip_module --with-http_addition_module --with-http_sub_module --with-
http_dav_module --with-http_stub_status_module --with-http_flv_module --with-htt
p_mp4_module --with-http_gzip_static_module --with-http_random_index_module --wi
th-http_secure_link_module --with-mail --with-openssl=objs.msvc8/lib/openssl-1.0
.1c --with-openssl-opt=enable-tlsext --with-http_ssl_module --with-mail_ssl_modu
le --with-ipv6



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