I'm very new to nginx, trying to add SSL on my website with the magnificent letsencrypt, helped with this tutorial
I have my file: /etc/nginx/sites-available/staging.example.com.conf, which contains:
server {
listen 443 ssl;
server_name staging.example.com;
ssl_certificate /etc/letsencrypt/live/staging.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/staging.example.com/privkey.pem;
access_log /var/log/nginx/staging.example.com.access.log;
error_log /var/log/nginx/staging.example.com.error.log;
location ~ \.(css|js|gif|jpg|png|html|svg|gz|ttf|otf|eot|woff|ico)$ {
root /vagrant/www/current/public;
expires 10d;
gzip_static on;
gzip_vary on;
}
error_page 502 /502.html;
}
server {
listen 80;
server_name staging.example.com;
return 301 https://$host$request_uri;
}
In /vagrant/www/current/public, I have test.html.
If I cURL http://staging.example.com/test.html, I get:
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.9.3</center>
</body>
</html>
But if I cURL https://staging.example.com/test.html I get curl: (7) Failed to connect to staging.mojjo.fr port 443: Connection timed out
Can't find any log or something (/var/log/nginx/staging.example.com.error.log doesn't contain anything). Any idea where I could find relevant information?
It feels like the port 80 rule works, but the listen 443 ssl won't.
Using nginx version: nginx/1.9.3
Can someone help? Thanks