hi
i want to enable ssl for nextcloud but all guides i have found seem to be out of date for the current freenas and its nextcloud plugin.
i have just fresh installed the current freenas 11.2.
i have successfully installed letsencrypt on it. now i want to use the cert also for nextcloud. please any help would be appreciated.
It seems that we are in the same boat.
The problem is that Nextcloud when installed as plugin on FreeNAS, it comes pre-configured with Nginx.
The solution is to edit the Nginx config file as follows:
Step 1: I highly recommend installing
nano editor because it's much easier to work with than Vi , and since the jail created for the plugin does not have the pkg repository enabled, we need to enable it manually. Type:
Vi /usr/local/etc/pkg/repos/FreeBSD.conf
Now we need to edit the file to say "enabled yes"
1- to delete the word "no", move the cursor to the letter "n", and press "d" on the keyboard
2- to start typing, press "i" on the keyboard, then write the word "yes", then Ctrl+c to exit typing mode.
3- enter the command ":wq!" (without quotes) on the keyboard to exit and save changes.
Step 2: install nano by typing
pkg install nano
Step 3: Locate the config file named "nextcloud.conf" using the command
find / -name nextcloud.conf
(mine was in /usr/local/etc/nginx/conf.d/nextcloud.conf)
Step 4: Stop Nginx service by typing
service nginx stop
Step 5: Type nano /usr/local/etc/nginx/conf.d/nextcloud.conf
(change the path if yours from Step 3 is different)
Step 6: At the top of the file, do the following:
1- change listen value from "80" to "443 ssl"
2- In a new line under Server_name, insert these four lines:
ssl_certificate /etc/ssl/cert.pem;
ssl_certificate_key /etc/ssl/key.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
Of course, you'll need to place your SSL certificate and key in the folder /etc/ssl, or simply edit the line to point to wherever yours are.
Step 7: Press Ctrl+o to save changes, then Ctrl+x to exit nano
Step 8: Start Nginx by typing
service nginx start
And that's it, enjoy your new installation of nextcloud.
Props to creators.
P.S.
You may encounter an error page where nextcloud trusted domains need to be updated.
The following simple guide by
LukasReschke was very helpful:
Trusted domains are used by Nextcloud to prevent Host Header Poisoning. You need to specify every domain at which your Nextcloud can be accessed. This means if you have Nextcloud installed at “192.168.0.29” and also want it to be accessible at “cloud.example.com” you’d need to modify the...
help.nextcloud.com
Simply type
nano /usr/local/www/nextcloud/config/config.php then follow the guide and you'll be fine. Took me 3 minutes.