Limit reqs per user / bot

djeyewater nginx-forum at forum.nginx.org
Thu Jan 7 22:30:45 UTC 2016


I want to limit requests to 1 per second for each user, counting a bot that
makes requests from multiple ips as a single user. Does this make sense:

map $http_user_agent $single_user {
	default $binary_remote_addr;
	~PaperLiBot 1;
}
	
limit_req_zone $single_user zone=one:10m rate=1r/s;

...

limit_req zone=one burst=2;



Thanks

Dave

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,263891,263891#msg-263891



More information about the nginx mailing list