title: Nginx https proxy, do not terminate ssl
body: <p>I want to proxy https requests to a certain domain to another address:</p>
  
  <pre><code>server {
      server_name site1;
      listen 443;
      ssl on;
  
      location / {
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header Host $host;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_pass https://172.17.0.1:44110;
      }
  }
  </code></pre>
  
  <p>Nginx complains with:</p>
  
  <pre><code>nginx: [emerg] no "ssl_certificate" is defined for the "ssl" directive in /etc/nginx/nginx.conf:33
  </code></pre>
  
  <p>The point is that the certificate is actually on the proxied server.</p>
  
  <p>How can I tell nginx to not terminate the ssl layer, and simply proxy it to the configured url?</p>
  
  <p>What I am looking for is something similar to <a href="https://stackoverflow.com/a/39701582/647991">this</a>, but with <code>server_name</code> support.</p>