server {
listen 80;
listen 443 ssl;
server_name www.site.ru site.ru;
rewrite ^(.*) https://$server_name$1 permanent;
ssl_certificate /etc/letsencrypt/live/site.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/site.ru/privkey.pem;