Redirect from HTTP WWW to HTTPS without WWW
server {
listen 80 default_server;
server_name www.example.com;
return 301 https://example.com$request_uri;
}
server {
listen 80 default_server;
server_name www.example.com;
return 301 https://example.com$request_uri;
}