title: Allow only one User-Agent, block the rest in nginx?
body: <p>new to this site so i'll keep it brief:</p>
  
  <p>I have currently:</p>
  
  <pre><code>    if ($http_user_agent ~* (A-certain-self-made-User-Agent-here)) {
              return 200;
      }
  </code></pre>
  
  <p>Which works very well. (Tested by switching 200 to 403).</p>
  
  <p><strong>My question is</strong>: Is there a way in: /etc/nginx/sites-enabled/default to make it allow only <strong>ONE</strong> User-Agent and deny the rest?</p>
  
  <p>I know this seems stupid, but it's something i'd like to have done, (if possible).
  <strong>Like maybe this?:</strong></p>
  
  <pre><code>    if (http_user_agent ~*(user-agent)) {
             return 200;
      else
             return 403;
      }
  </code></pre>