You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# How to Resolve Rate Limited Requests (429 Too Many Requests)
16
14
17
15
To protect your Hypernode from all kinds of attacks, bots, brute forces, and scriptkiddies causing downtime, we've implemented several layers of rate limiting.
@@ -130,7 +128,7 @@ To prevent a single IP from using all the FPM workers available simultaneously,
130
128
In some cases, it might be necessary to exclude specific IP addresses from the per IP rate limiting. If you wish to exclude an IP address, you can do so by creating a config file called `/data/web/nginx/http.ratelimit` with the following content:
131
129
132
130
```nginx
133
-
geo $conn_limit_map {
131
+
geo $limit_conn_per_ip {
134
132
default $remote_addr;
135
133
198.51.100.69 '';
136
134
}
@@ -141,7 +139,7 @@ In this example, we have excluded the IP address **198.51.100.69** by setting an
141
139
In addition to excluding a single IP address, it is also possible to allow a whole range of IP addresses. You can do this by using the so-called CIDR notation (e.g., 198.51.100.0/24 to whitelist all IP addresses within the range 198.51.100.0 to 198.51.100.255). In that case, you can use the following snippet in `/data/web/nginx/http.ratelimit` instead:
142
140
143
141
```nginx
144
-
geo $conn_limit_map {
142
+
geo $limit_conn_per_ip {
145
143
default $remote_addr;
146
144
198.51.100.0/24 '';
147
145
}
@@ -154,7 +152,7 @@ When your shop performance is very poor, it’s possible all your FPM workers ar
154
152
For debugging purposes, however, it could be helpful to disable the per-IP connection limit for all IP’s. With the following snippet in `/data/web/nginx/http.ratelimit` , it is possible to altogether disable IP based rate limiting:
155
153
156
154
```nginx
157
-
geo $conn_limit_map {
155
+
geo $limit_conn_per_ip {
158
156
default '';
159
157
}
160
158
```
@@ -179,7 +177,7 @@ if ($request_uri ~ ^\/elasticsearch.php$ ) {
179
177
In the example above, the URLs `*/rest/V1/example-call/*` and `/elasticsearch.php` are the ones that have to be excluded. You now have to use the `$ratelimit_request` variable as a default value in the file `/data/web/nginx/http.ratelimit` (see below) to exclude these URLs from the rate limiter and make sure that bots and crawlers will still be rate limited based on their User Agent.
0 commit comments