In lighttpd we can block or deny access to a specific user agent.

Syntax to block user agent:

$HTTP["useragent"] =~ "User agent name" {url.access-deny = ( "" )} 30 more words