I would like to use the same limit_req_zone
(i.e. the same request rate) across various locations, but with different burst
values for limit_req
. The following configuration should be able to serve 2 pages, and up to 10 supporting assets for a page in a single burst. It tests ok, but is this the right way to do it, or would I need two different limit_req_zone
directives?
http {
limit_req_zone $binary_remote_addr zone=lr_zone:10m rate=1r/s;
#...
server {
#...
location / {
limit_req zone=lr_zone burst=2 nodelay;
#...
}
location ~ ^/(css|fonts|images|pdf)/ {
limit_req zone=lr_zone burst=10 nodelay;
#...
}
}
}