Bloqueando todos os bots, exceto alguns com o Nginx

Gostaria de bloquear todos os http_user_agents que se identificam como bots, mas permitir o Googlebot quando eu colocar o seguinte código:

map $http_user_agent $bad_bot {
default 1;
~*^Lynx 0; # Let Lynx go through
~*^google );
libwww-perl                      1;
~(?i)(libwww|Wget|LWP::Simple|BBBike|java|crawl|spider|bot) 1;
}

no entanto, esse bloqueio bloqueia o acesso ao googlebot.