title: Nginx rule to add x-robots-tag header
body: <p>I just moved from apache to nginx and cant fathom this rule.</p>
  
  <p>I want to add this header to all pages that include a query string.</p>
  
  <pre><code>add_header X-Robots-Tag "noindex, nofollow";
  </code></pre>
  
  <p>The apache working rule was.</p>
  
  <pre><code>RewriteCond %{QUERY_STRING} (^|&amp;)(sortOrder|sortField) [NC]
  RewriteRule .* - [E=MY_SET_HEADER:1]
  Header set X-Robots-Tag "noindex,nofollow" env=MY_SET_HEADER
  </code></pre>
  
  <p>Thanks in advance.</p>