Welcome! Log In Create A New Profile

Advanced

Re: rate limit with good bot IPs whitelisted

Oleksandr V. Typlyns'kyi
November 22, 2014 03:00PM
Today Nov 22, 2014 at 09:42 neubyr wrote:

> > It will not work as you expect.
> > Geo does not support variables in values.
> > You need something like this:
> > geo $whitelist {
> > default 0;
> > 127.0.0.1 1;
> > ...
> > }
> > map $whitelist $rate_limit_ip {
> > default $binary_remote_addr;
> > 1 "";
> > }
> >
> >
> I am not sure how, but it's working only with geo defining IP addresses. I
> can see HTTP 503 on client side and also 'limiting requests, excess: 10.033
> by zone' in error logs. Nginx version: nginx/1.6.0
>
> geo $rate_limit_ip {
> default $binary_remote_addr;
> 127.0.0.1 1;
> 10.0.0.0/8 1;
> }

You define key "$binary_remote_addr"(string, not variable) and clients
share one limit for all.

> I was wondering if remote ip's hostname lookup can be done before
> rate-limiting it. For example, I don't want to block IPs coming from
> baidu.com. Can I do such IP-hostname lookup before rate-limiting? Will it
> efficient or what are other options?

Nginx does not lookup remote hostnames at all.

--
WNGS-RIPE

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

rate limit with good bot IPs whitelisted

neubyr November 21, 2014 11:10PM

Re: rate limit with good bot IPs whitelisted

Oleksandr V. Typlyns'kyi November 22, 2014 10:36AM

Re: rate limit with good bot IPs whitelisted

neubyr November 22, 2014 12:44PM

Re: rate limit with good bot IPs whitelisted

Oleksandr V. Typlyns'kyi November 22, 2014 03:00PM

Re: rate limit with good bot IPs whitelisted

itpp2012 November 22, 2014 03:53PM

Re: rate limit with good bot IPs whitelisted

neubyr November 25, 2014 12:00PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 147
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