title: Nginx don't block bot by user-agent
body: <p>I'm trying to ban annoying bot by user-agent. I put this into server section of nginx config:</p>
  
  <pre><code>server {
  
      listen 80 default_server;
  
      ....
  
      if ($http_user_agent ~* (AhrefsBot)) {
         return 444;
      }
  </code></pre>
  
  <p>checking by curl:</p>
  
  <pre><code>    [root@vm85559 site_avaliable]# curl -I -H 'User-agent: Mozilla/5.0 (compatible; AhrefsBot/5.2; +http://ahrefs.com/robot/)' localhost/
  curl: (52) Empty reply from server
  </code></pre>
  
  <p>so i check /var/log/nginx/access.log and i see some connections get 444, but another connections get 200!</p>
  
  <pre><code>51.255.65.78 - - [25/Jun/2017:15:47:36 +0300 - -] "GET /product/kovriki-avtomobilnie/volkswagen/?PAGEN_1=10 HTTP/1.1" 444 0 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.2; +http://ahrefs.com/robot/)" 1498394856.155
  217.182.132.60 - - [25/Jun/2017:15:47:50 +0300 - 2.301] "GET /product/bryzgoviki/toyota/ HTTP/1.1" 200 14500 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.2; +http://ahrefs.com/robot/)" 1498394870.955
  </code></pre>
  
  <p>How is it possible?</p>