server {
# listen on port 80 (http)
listen 80;
server_name wellword.ru;
location / {
# redirect any requests to the same URL but on https
return 301 https://$host$request_uri;
}
}
server {
# listen on port 443 (https)
listen 443 ssl;
server_name _;
# location of the self-signed SSL certificate
ssl_certificate /etc/letsencrypt/live/wellword.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/wellword.ru/privkey.pem;
# ssl_certificate /etc/letsencrypt/live/keyword.pictures/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/keyword.pictures/privkey.pem;
server {
# listen on port 80 (http)
listen 80;
server_name keyword.pictures;
location / {
# redirect any requests to the same URL but on https
return 301 https://$host$request_uri;
}
}
server {
# listen on port 443 (https)
listen 443 ssl;
server_name _;
# location of the self-signed SSL certificate
# ssl_certificate /etc/letsencrypt/live/wellword.ru/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/wellword.ru/privkey.pem;
ssl_certificate /etc/letsencrypt/live/keyword.pictures/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/keyword.pictures/privkey.pem;
Guys, I added the server name 'wellword.ru' to this section (and "keyword.pictures" to another .conf file) and it looks wellword.ru works fine now.
But www.wellword.ru still pointing at keyword.pictures cert.
Thank you a lot! Now HTTPS works on both domain names.
Thank you for the article too! There is an Ubuntu 18 on the server and it is what I plan to move forward next (add another but static page)