server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name site.ru www.site.ru;
location / {
try_files $uri $uri/ =404;
}
return 301 https://site.ru$request_uri;
}