Recently I bought a SSL certificate on GoDaddy and set it up in my Nginx server like this:
server {
listen 443 ssl default_server;
server_name www.mywebsite.example;
ssl on;
ssl_certificate /path/to/certificates/mywebsite.example.chained.crt;
ssl_certificate_key /path/to/certificates/mywebsite.example.key;
root /var/www/www.mywebsite.example;
index index.html;
location / {
index index.html;
}
}
I'm using the sample HTML site from Nginx. Previously I did exactly the same with port 80 (without SSL) and I was able to access the site successfully with my domain.
My Nginx server is in a EC2 instance. I made sure that the port 443 has external access and double checked it with sudo netstat -ntlp | grep LISTEN
. It shows up like:
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 24561/nginx: master
Whenever I try to load https://www. mywebsite.example
it results in a ERR_CONNECTION_TIMED_OUT error. I don't get anything in the Nginx error logs.
The domain is hosted in Route 53. Am I supposed to manage the DNS records in some way to support HTTPS?