title: Nginx rewrite domain and URLs
body: <p>I'm configuring nginx with multiple server names, and trying to set up the following rewrite rules </p>
  
  <pre><code>redirect / on old.domain.com to new.domain.com/specific_page.php
  redirect old.domain.com/$1 to new.domain.com/$1
  </code></pre>
  
  <p>In my "server" configuration, I have already the first rewrite condition working, but I cannot find the way to write the second.</p>
  
  <pre><code>if ($host = 'old.domain.com' ) {
      rewrite  ^/  http://new.domain.com/my-specific/link/list/info.php  permanent;
      rewrite  ^/(.*)$  http://old.domain.com/$request_uri?  permanent;
  }
  </code></pre>
  
  <p>Any ideas how to handle easily this scenario? (I realise this might be an unusual setup.)</p>