title: Redirect https to https://www
body: <p>At present i use this to redirect <code>domain.com</code> to <code>https://www.domain.com</code></p>
  
  <pre><code>server {
      #listen 80 is default
      server_name domain.com;
      return 301 https://www.domain.com$request_uri;
  }
  server {
      listen       443 ; 
      server_name  www.domain.com;
      //rest of config goes here
  }
  </code></pre>
  
  <p>However some part of it is flawed since <code>https://domain.com</code> is not redirected to <code>https://www.domain.com</code></p>
  
  <p>Any idea of how to  modify the above to achieve that objective....</p>