Good afternoon. I'm trying to deploy my first website but I'm having problems with SSL. If anyone could help me I would be very grateful.
My domain is: intdrivingacademy.com & www.intdrivingacademy.com
I ran this command: sudo certbot --nginx -d intdrivingacademy.com -d www.intdrivingacademy.com
It produced this output: (Y)es/(N)o: y
Account registered.
Requesting a certificate for intdrivingacademy.com
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/intdrivingacademy.com/fullchain.pem
Key is saved at: /etc/letsencrypt/live/intdrivingacademy.com/privkey.pem
This certificate expires on 2024-05-08.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.
Deploying certificate
Successfully deployed certificate for intdrivingacademy.com to /etc/nginx/sites-enabled/default.conf
Congratulations! You have successfully enabled HTTPS on https://intdrivingacademy.com
We were unable to subscribe you the EFF mailing list because your e-mail address appears to be invalid. You can try again later by visiting https://act.eff.org.
My web server is (include version): nginx version: nginx/1.21.4
The operating system my web server runs on is (include version): Ubuntu 22.04.3 LTS"
My hosting provider, if applicable, is: VPS HOSTINGER
The problem is that apparently I had the certificate without any problem, but when I try to enter my domain I get ERR_SSL_UNRECOGNIZED_NAME_ALERT.
This is my configuration in Nginx
/etc/nginx/sites-available/default
server {
listen 80;
server_name intdrivingacademy.com www.intdrivingacademy.com;
location / {
proxy_pass http://localhost:4000/;
}
}
and the configuration that was added after certification in
/etc/nginx/sites-enabled/default.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
ssl_reject_handshake on;
server_name _;
return 444;
}
server {
ssl_reject_handshake on;
server_name intdrivingacademy.com; # managed by Certbot
return 444;
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/intdrivingacademy.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/intdrivingacademy.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}server {
if ($host = intdrivingacademy.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80 ;
listen [::]:80 ;
server_name intdrivingacademy.com;
return 404; # managed by Certbot
}
I would be very grateful if anyone can help me. I'm new to this, and I've been trying to solve it for two days. I have reset my vps and reinstalled everything but I always get the same error when accessing my domain