title: Nginx redirect URL with specific query parameter
body: <p>Nginx, I am trying to permanently redirect the URLs with a <code>device</code> GET parameter (<a href="http://www.example.org/page?device=desktop" rel="noreferrer">http://www.example.org/page?device=desktop</a>) to the relative URL without this parameter (<a href="http://www.example.org/page" rel="noreferrer">http://www.example.org/page</a>).</p>
  
  <p>I did this, but it doesn't work.</p>
  
  <pre><code>location {
      rewrite ^(.*)\?device=desktop $1 permanent;
  }
  </code></pre>