Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Conditional application of limit_conn directive

Maxim Dounin
September 22, 2020 09:20AM
Hello!

On Tue, Sep 22, 2020 at 04:53:25PM +1000, turchanov@farpost.com wrote:

> Patch with tests will follow
>
> # HG changeset patch
> # User Sergei Turchanov <turchanov@farpost.com>
> # Date 1600756248 -36000
> # Tue Sep 22 16:30:48 2020 +1000
> # Node ID 2cf4e00bb96b17142a82e5f1868197465cf5c194
> # Parent 052ecc68d35038b1b4adde12efe6249a92055f09
> Conditional application of limit_conn directive
>
> Implemented conditional application of limit_conn directive.
> Since limit_conn directive cannot be used inside 'if' block, an optional
> parameter 'if=condition' was introduced to control whether the limit is
> applied or not. The limit will not be applied if the condition evaluates
> to "0" or an empty string.

Thank you for the patch.

Quoting the documentation (http://nginx.org/r/limit_conn_zone):

: Requests with an empty key value are not accounted.

That is, limit_conn can be used conditionally without any
code changes. The same applies to limit_req.

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

[PATCH] Conditional application of limit_conn directive

Anonymous User 523 September 22, 2020 02:54AM

Re: [PATCH] Conditional application of limit_conn directive

Maxim Dounin 196 September 22, 2020 09:20AM

Re: [PATCH] Conditional application of limit_conn directive

Anonymous User 203 September 22, 2020 10:40AM

Re: [PATCH] Conditional application of limit_conn directive

Anonymous User 180 October 12, 2020 12:12AM

Re: [PATCH] Conditional application of limit_conn directive

Maxim Dounin 191 October 12, 2020 12:50PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

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