title: Nginx serves different website (on the same sever) when using HTTPS
body: <p>I have several websites hosted on the same sever. To simplify I have just 2 (<code>http-only.com</code> and <code>https.com</code>) and using nginx to handle requests.<br>
  One has SSL enabled. And another doesn't. I noticed links like this in Google Search Console <code>http-only.com/https_server_path</code> and when accessing an <code>http-only.com</code> server with <code>https</code> protocol I get requests served by an <code>https.com</code> server instead.<br>
  <strong>https.com:</strong></p>
  
  <pre><code>server {
    listen 443 ssl;
    server_name https.com;
    ssl on;
  }
  </code></pre>
  
  <p><strong>only-http.com:</strong></p>
  
  <pre><code>server {
    listen 80;
    server_name only-http.com;
  }
  </code></pre>
  
  <p>I think I should define something like a default ssl server to handle ssl for <code>http.com</code>, but don't know how to do it properly. I guess nginx should redirect https request to an http url if corresponding server doesn't handle https. Or maybe there is a better solution? </p>