listen 443 ssl default_server;
openssl genrsa -out rootCA.key 2048
openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.pem
ssl_certificate /etc/nginx/ssh/rootCA.pem;
ssl_certificate_key /etc/nginx/ssh/rootCA.key;
server {
if ($host = {ваш_домен}) {
return 301 http://$host$request_uri;
}
}