location PATHTOCHANGE { alias ALIASTOCHANGE; if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } client_max_body_size 10G; }