You can refer to the following configuration:
server {
listen 80;
server_name xxx.com www.xxx.com;
return 301 https://$host$request_uri;
}
You can refer to the following configuration:
server {
listen 80;
server_name xxx.com www.xxx.com;
return 301 https://$host$request_uri;
}