a. rewrite ^ https://$http_host$request_uri? permanent;
b. rewrite ^/(.*)$ http://domain.com/$1 permanent;
c. return 301 https://$server_name$request_uri;