title: Nginx 301 redirect old domain to the single homepage on a new domain
body: <p>I'm trying to redirect multiple URL on the old domain to the single page on the new one.</p>
  
  <pre><code>old-domain.com/one
  old-domain.com/query?=two
  old-domain.com/one/cat+mouse
  </code></pre>
  
  <p>Should all redirect to <code>new-domain.com/</code></p>
  
  <p>Using the following, it redirects the whole path, not to the homepage:</p>
  
  <pre><code>server {
    listen 80;
    server_name old-domain.com;
    return 301 http://new-domain.com;
  }
  </code></pre>