server {
listen ип:80;
server_name domain.ru www.domain.ru;
return 301 https://domain.ru$request_uri;
}
server {
listen ип:443 ssl;
server_name www.domain.ru;
return 301 https://domain.ru$request_uri;
}
server {
listen ип:443 ssl;
server_name domain.ru;