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
2020/06/07 13:33:37 [error] 7492#7492: *1590770 limiting connections by zone "zoneperip", client: 198.51.100.69, server: example.hypernode.io, request: "POST /admin/ HTTP/2.0", host: "example.hypernode.io"
42
-
43
42
```
44
43
45
44
A log entry where rate limit is applied to user-agents and requests per second (based on the `bots` zone):
@@ -89,15 +88,15 @@ The keywords are separated by `|` characters since it is a regular expression.
89
88
90
89
To extend the allowlist, first determine what user agent you wish to add. Use the access log files to see what bots get blocked and which user agent identification it uses. To find the user agent, you can use the following command:
2020-06-07T13:33:37+00:00 429 203.0.113.104 GET /api/ HTTP/2.0 SpecialSnowflakeCrawler 3.1.4
95
94
2020-06-07T13:35:37+00:00 429 203.0.113.104 GET /api/ HTTP/2.0 SpecialSnowflakeCrawler 3.1.4
96
95
```
97
96
98
97
In the example above you can see that a bot with the User Agent `SpecialSnowflakeCrawler 3.1.4` triggered the ratelimiter. As it contains the word ‘crawler’, it matches the second regular expression and is labeled as a bot. Since the allowlist line overrules the denylist line, the best way to allow this bot is to add their user agent to the allowlist instead of removing ‘crawler’ from the blacklist:
In this example, we have excluded the IP address **198.51.100.69** by setting an empty value in the form of `''`.
@@ -147,7 +145,6 @@ geo $conn_limit_map {
147
145
default $remote_addr;
148
146
198.51.100.0/24 '';
149
147
}
150
-
151
148
```
152
149
153
150
### Disable per IP Rate Limiting
@@ -160,7 +157,6 @@ For debugging purposes, however, it could be helpful to disable the per-IP conne
160
157
geo $conn_limit_map {
161
158
default '';
162
159
}
163
-
164
160
```
165
161
166
162
**Warning: Only use this setting for debugging purposed! Using this setting on production Hypernodes is highly discouraged, as your shop can be easily taken offline by a single IP using slow and/or flood attacks.**
@@ -178,7 +174,6 @@ if ($request_uri ~ ^\/(.*)\/rest\/V1\/example-call\/(.*) ) {
178
174
if ($request_uri ~ ^\/elasticsearch.php$ ) {
179
175
set $ratelimit_request_url '';
180
176
}
181
-
182
177
```
183
178
184
179
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