Something like
map $remote_addr $exclude_from_limit {
default 0;
192.168.1.1 1;
192.168.1.2 1;
}
and then wrap the limits in an if
if ($exclude_from_limit = 0) {
limit_req zone=flood burst=24 nodelay;
limit_req zone=bot burst=400 nodelay;
limit_conn connperip 20;
}
Yes, you should do some replacing with pups during build to make this persistent, see for instance web.ssl.template.yml on how to approach that.
Or you could forget about this and make your API client script run more slowly by inserting some sleeps in strategic places. ← recommended approach