title: Nginx Exclude a query string url from being redirected
body: <p>I am currently redirecting my root domain to a subfolder. However I want to exclude a query string url which is used for an ajax call (www.example.com/?act=12). I am however unsure of how to do this in nginx.</p>
  
  <p>This is my current nginx config file</p>
  
  <pre><code>server {
          listen          80;
          server_name     example.com;
          return 301      http://www.example.com$request_uri;
  
  }
  
  server {
          listen 80;
          server_name www.example.com;
          root /var/www/example.com/public;
  
          index index.php index.html;
  
          location = / {
                  return 301 http://www.example.com/it/;
          }
  
          location / {
                  proxy_pass http://localhost:8080;
                  include /etc/nginx/proxy_params;
          }
  
          location ~* \.(js|css|jpg|jpeg|gif|png|svg|ico|pdf|html|htm)$ {
                  expires 30d;
          }
  
          location ~ /\.ht {
          deny  all;
      }
  }
  </code></pre>
  
  <p>Any help will be appreciated.</p>