title: Disable logging in nginx for specific request
body: <p>I'm trying to "ignore" or redirect certain request in the nginx log based on the request URI. </p>
  
  <p>So far I have this:</p>
  
  <pre><code>server {
    listen      80;
    #...
    access_log  /var/log/nginx/site.access;
    error_log   /var/log/nginx/site.error info;
    #...
  
    try_files $uri @app
  
    location = /lbcheck.html {
      access_log off;
      log_not_found off;
      try_files $uri @app;
    }
  
    location @app {
      proxy_redirect     off;
      proxy_pass http://unix:/tmp/site.unicorn.sock;
      #...
    }
  
  }
  </code></pre>
  
  <p>Basically I want the proxied @app to respond to the request for <code>/lbcheck.html</code> but I don't want it logged in <code>/var/log/nginx/site.access;</code></p>
  
  <p>I know i can do it with a <code>if ($uri = /lbcheck.html) { access_log off; }</code> in <code>location @app</code> but if's are evil, so I don't want to use them.</p>