server { listen 80; server_name domain.com www.domain.com; return 301 https://domain.com$request_uri; }