Forcing NextCloud to use SSL is a pretty painless. I’m assuming that you already have an SSL certificate on your hosting installed. if not check out my tutorial here. How To: Install SSL on cPanel Hosting

Luckily the process for getting it working is very simple. You simply edit the .htaccess file in the root of your web folder.

    1. Log into your hosting via FTP. I would recommend using FileZilla. You can get the FTP details from your hosting
    2. In the root of your web folder, copy the .htaccess file to your computer
    3. Open notepad (I like atom) and add the following line under the line  #### DO NOT CHANGE ANYTHING ABOVE THIS LINE ####
      RewriteCond %{HTTPS} off
      RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
    4. Next save this file, when you click save make sure you select “all files” (if using notepad) from the drop down and make the name “.htaccess. Ensure that there is no .txt after the name
    5. Once this file is saved you can then upload it to your web host. Ensure that you put it in the root directory of your site where you downloaded it from
    6. Now your NextCloud site should be forced to use SSL