Christian Staudte
April 05, 2021 07:48AM
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
Subject Author Posted

limit_req_zone for IPv6 subnets

Christian Staudte April 04, 2021 04:14PM

RE: limit_req_zone for IPv6 subnets

Thomas Ward April 04, 2021 07:00PM

Re: limit_req_zone for IPv6 subnets

Maxim Dounin April 04, 2021 07:14PM

Re: limit_req_zone for IPv6 subnets

Christian Staudte April 05, 2021 07:48AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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