Reputation: 113
I got ssl cert from let's encrypt for domain.me
and www.domain.me
using this tutorial on DigitalOcean.
Everything worked fine.
Then I've created sub.domain.me
and www.sub.domain.me
and tried to get ssl certs for them using the same steps.
sub.domain.me
works fine. But when I try to get www.sub.domain.me
in browser the error occures:
Your connection is not private. NET::ERR_CERT_COMMON_NAME_INVALID
What am I doing wrong?
I am not using a wildcard certificate, as LetsEncrypt does not support this
server
block which causes the problem look like:
server {
listen:80;
listen 443 ssl;
server_name www.sub.domain.me;
return 301 $sheme://sub.domain.me$request_uri;
}
Upvotes: 0
Views: 206
Reputation: 2595
Try to add:
ssl_certificate /opt/nginx/ssl/server.pem;
ssl_certificate_key /opt/nginx/ssl/server.key;
to server block ( of course with Your path and file names ). If subdomains have other certificate, use path to them.
But it's hard to say what is wrong without all nginx config
Upvotes: 1