# whitelisted user agents - will not have limits applied
map $http_user_agent $whitelist {
~*Macintosh 1;
~*iPhone 0;
}
# if whitelist is 0, put the binary IP address in $limit so the rate limiting has something to use
map $whitelist $limit {
0 $binary_remote_addr;
1 "";
}
limit_req_zone $limit zone=perip:10m rate=1r/s;
location = / {
limit_req zone=perip burst=1 nodelay;
limit_req_status 444;
}