Mercurial > hg > nginx-site
comparison xml/en/docs/http/ngx_http_core_module.xml @ 2384:144c8e3d6c09
Documented variables support in limit_rate and limit_rate_after.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Wed, 15 May 2019 18:42:38 +0300 |
parents | 896562a1ccde |
children | 655e7de7fd4b |
comparison
equal
deleted
inserted
replaced
2383:e01b7a3b601d | 2384:144c8e3d6c09 |
---|---|
8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> | 8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> |
9 | 9 |
10 <module name="Module ngx_http_core_module" | 10 <module name="Module ngx_http_core_module" |
11 link="/en/docs/http/ngx_http_core_module.html" | 11 link="/en/docs/http/ngx_http_core_module.html" |
12 lang="en" | 12 lang="en" |
13 rev="81"> | 13 rev="82"> |
14 | 14 |
15 <section id="directives" name="Directives"> | 15 <section id="directives" name="Directives"> |
16 | 16 |
17 <directive name="absolute_redirect"> | 17 <directive name="absolute_redirect"> |
18 <syntax><literal>on</literal> | <literal>off</literal></syntax> | 18 <syntax><literal>on</literal> | <literal>off</literal></syntax> |
1045 two connections, the overall rate will be twice as much | 1045 two connections, the overall rate will be twice as much |
1046 as the specified limit. | 1046 as the specified limit. |
1047 </para> | 1047 </para> |
1048 | 1048 |
1049 <para> | 1049 <para> |
1050 Rate limit can also be set in the <var>$limit_rate</var> variable. | 1050 The value can contain variables (1.17.0). |
1051 It may be useful in cases where rate should be limited | 1051 It may be useful in cases where rate should be limited |
1052 depending on a certain condition: | 1052 depending on a certain condition: |
1053 <example> | |
1054 map $slow $rate { | |
1055 1 4k; | |
1056 2 8k; | |
1057 } | |
1058 | |
1059 limit_rate $rate; | |
1060 </example> | |
1061 </para> | |
1062 | |
1063 <para> | |
1064 Rate limit can also be set in the | |
1065 <link id="var_limit_rate"><var>$limit_rate</var></link> variable, | |
1066 however, since version 1.17.0, this method is not recommended: | |
1053 <example> | 1067 <example> |
1054 server { | 1068 server { |
1055 | 1069 |
1056 if ($slow) { | 1070 if ($slow) { |
1057 set $limit_rate 4k; | 1071 set $limit_rate 4k; |
1087 <appeared-in>0.8.0</appeared-in> | 1101 <appeared-in>0.8.0</appeared-in> |
1088 | 1102 |
1089 <para> | 1103 <para> |
1090 Sets the initial amount after which the further transmission | 1104 Sets the initial amount after which the further transmission |
1091 of a response to a client will be rate limited. | 1105 of a response to a client will be rate limited. |
1106 The value can contain variables (1.17.0). | |
1092 </para> | 1107 </para> |
1093 | 1108 |
1094 <para> | 1109 <para> |
1095 Example: | 1110 Example: |
1096 <example> | 1111 <example> |