title: Nginx Redirect Subdomain with SSL
body: <p>So I've got this port 80 redirect working fine</p>
  
  <pre><code>server {
      listen  80;
      server_name "~^(?&lt;subdomain&gt;.+)\.site-box\.it$";
      rewrite ^(.*)$ https://$subdomain.sitebox.co permanent;
  }
  </code></pre>
  
  <p>But I want https to work too, because some old links are left around that have <code>https://guy.site-box.it</code></p>
  
  <p>But this doesn't work</p>
  
  <pre><code>server {
      listen  443;
      server_name "~^(?&lt;subdomain&gt;.+)\.site-box\.it$";
      rewrite ^(.*)$ https://$subdomain.sitebox.co permanent;
  }
  </code></pre>
  
  <p>It seems to cause nothing in the Nginx conf file to work.  I just get cloudflare errors on the main site, and on the testing guy.site-box.it it just says page is not available.</p>
  
  <p>Any idea how to get the SSL subdomain to work?</p>