I am trying to configure SSL on my localhost using Nginx. I created a self-signed certificate and my Nginx configuration is as below:
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;
}
}
But when I try accessing it gives me following error
$ curl -i https://localhost
curl: (7) Failed to connect to localhost port 443: Connection refused
What could be the possible cause for this error?
This is the output of command 'netstat -tuplen'
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 0 71662 -