title: How to set limit_req on a certain folders?
body: <p>How can I set limit_req on all folders except on a "uploads and public" for example.</p>
  
  <p>What I've tried:</p>
  
  <pre><code>    location / {
          root /var/www/html/public;
                              if ( $uri !~ ^/(uploads|public) ) {
                                  limit_req zone=one burst=5 nodelay;
                              }
  ...
  </code></pre>
  
  <p>error:</p>
  
  <pre><code>nginx: [emerg] "limit_req" directive is not allowed here in /etc/nginx/sites-enabled/my.conf:20
  </code></pre>