title: Nginx SSL on localhost
body: <p>I am trying to configure SSL on my localhost using Nginx. I created a self signed certificate and my nginx configuration is as below.</p>
  
  <pre><code>server {
      listen 443 ssl;
      server_name localhost;
  
      root /usr/share/nginx/html;
      index index.html index.htm;
  
      ssl on;
      ssl_certificate /etc/nginx/ssl/nginx.crt;
      ssl_certificate_key /etc/nginx/ssl/nginx.key;
  
      ssl_session_timeout 5m;
  
      ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
      ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
      ssl_prefer_server_ciphers on;
  
      location / {
              try_files $uri $uri/ =404;
      }
  }
  </code></pre>
  
  <p>But when I try accessing it gives me following error</p>
  
  <pre><code>$ curl -i https://localhost            
    curl: (7) Failed to connect to localhost port 443: Connection refused
  </code></pre>
  
  <p>What could be the possible cause for this error? </p>
  
  <p>This is the output of command 'netstat -tuplen'</p>
  
  <p><code>tcp    0     0 0.0.0.0:443     0.0.0.0:*      LISTEN     0    71662</code>    - </p>