Welcome! Log In Create A New Profile

Advanced

Re: lmit_req with differents rules

Maxim Dounin
December 15, 2022 02:42PM
Hello!

On Thu, Dec 15, 2022 at 09:50:46AM -0300, Rejaine Monteiro wrote:

> Hello!!
>
> I need apply different limit_req rules with different rules, like
>
> limit_req_zone $binary_remote_addr zone=ipsrc:10m rate=1r/s;
> limit_req_zone $arg_token zone=apitoken:10m rate=5r/m;
> limit_req_zone $http_autorization zone=httpauth:10m rate=5r/s;
>
> server {
> listen 443;
> server_name api.domain.com;
> }
>
> location / {
> limit_req zone=ipsrc;
> limit_req zone=apitoken;
> limit_req zone=httpauth;
> proxy_pass http://internal.api.com;
> }
> }
>
> Would this be correct and should it work as expected?

This is certainly supported, see http://nginx.org/r/limit_req for
details.

Note that it might be a good idea to add some meaningful "burst"
to the configuration, as well as "nodelay".

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

lmit_req with differents rules

Rejaine Monteiro December 15, 2022 07:52AM

Re: lmit_req with differents rules

Maxim Dounin December 15, 2022 02:42PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 183
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready