Hi,

On 05.04.21 01:13, Maxim Dounin wrote:
> You can use anything as a key in limit_req_zone, including your 
> own variables.  If you want to limit IPv6 addresses per /64 
> subnets, something like this should work:
> 
> map $binary_remote_addr $subnet {
>     "~^(\C{8})"         $1;
>     default             $binary_remote_addr;
> }
> 
> limit_req_zone $subnet zone=one:10m rate=1r/s;

This seems to work, very nice! That should definitely be added to the
docs and maybe also to the blog post
(https://www.nginx.com/blog/rate-limiting-nginx/).

Regards, Chris
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to