server
{
	listen 80;
	server_name www.domain.com domain.com;

	rewrite ^(.*)$ https://$server_name$1 permanent;
}