Welcome! Log In Create A New Profile

Advanced

limit_zone and custom variable

Sergej Kurakin
February 11, 2010 03:06PM
Hi,

I have a question about limit_zone and custom variable. I'm analysing
situation with strange 503 errors messages for users that do first
request to server with NGINX 0.6.x As I see from NGINX source error
503 showed in only one situation - when client reaches connection
limits.

In NGINX configuration file in http section limit_zone with custom
variable defined in next way:

http {
....
limit_zone ten $my_remote_addr 1m;
....
[servres section]
}

and $my_remote_addr is not defined anywhere in http section.

In server section $my_remote_addr defined for any user in one way,
except for some IP range (some proxy servers) - you can see it above:

server {
....
set $my_remote_addr $binary_remote_addr;

if ($remote_addr ~ "^(XXX\.XXX\.XXX|YYY\.YYY\.YYY)\.") {
set $my_remote_addr $binary_remote_addr$remote_port;
}

limit_conn ten 11;
....
}

Will this configuration impact NGINX's limit functionality in non-
predictable behaviour? I can't understand how limits work with this
settings from source code :-( Maybe someone know answer for that
question?

Should we change it and before setting "limit_zone ten $my_remote_addr
1m;" use "set $my_remote_addr $binary_remote_addr$remote_port;" for
any IP?


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

limit_zone and custom variable

Sergej Kurakin February 11, 2010 03:06PM

Re: limit_zone and custom variable

Denis Filimonov February 12, 2010 10:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 212
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready