title: Blocking all bots except a few with Nginx
body: <p>I would like to block all the http_user_agents which identify as bots but allow Googlebot when I put the following code:</p>
  
  <pre><code>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;
  }
  </code></pre>
  
  <p>however, this block access to even googlebot.</p>