V
V
Vadim2021-09-14 21:07:17
Nginx
Vadim, 2021-09-14 21:07:17

How to limit the frequency of requests to a specific URL in NGINX?

There is a site, let's say site.com, and I don't want to limit the speed to the site as a whole, but I want to restrict access to a specific site.com/page url from one ip no more than 1 time in 5 seconds. I don't understand how to do it. After all, if I set the limit_req_zone directive , then it already works for the entire site and includes a restriction, but I don’t need it. How to be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2021-09-14
@ky0

limit_reqlimits (not the access speed, by the way, but the frequency of requests - it drives the speed limit_rate) exactly where you add it. Add in a separate location with the necessary urls - it will not limit the entire site, but only certain urls.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question