Ubuntu
RewriteEngine on
RewriteCond %{HTTP:CF-Visitor} '"scheme":"http"'
RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]