# Ловит всех по http
server {
listen 80;
server_name site.com www.site.com;
return 301 https://site.com$request_uri;
}
# Только https, с лишним www.
server {
listen 443 ssl;
server_name www.site.com;
return 301 https://site.com$request_uri;
}