Nextcloud + TrueNAS https/ssl setup

asw2012

Contributor
Joined
Dec 17, 2012
Messages
182
I have been trying to establish a secure HTTPS setup with my domain and nextcloud installation on TrueNAS. Been scouting for almost a week now, but all I am seeing are older tutorials before nextcloud made the switch to force HTTPS - these tutorials it seems won't work on the new version 22.2 nextcloud. I am not savvy enough to take the existing information and tutorials to make it work on my installation.

here are the steps I have taken so far:

Nextcloud 22.2
TrueNAS 12.0-U6

  • Installed fresh Nextcloud instance onto my TrueNAS server
  • Using static IP address for my internal network
  • nextcloud installation works well
    • can access from multiple devices inside and outside my network typing in my domain
  • existing domain from ionos.com
    • created a subdomain for nextcloud
  • forwarded ionos domain to my IP address
  • port 80 and 443 are forwarded on my router to my internal nextcloud server
  • All works well, I type in my domain, and I get directed to my server
*I have downloaded SSL *.cer file from ionos.com and a *.key file for my domain. Is it as simple as copying these files into the nextcloud jail? If so, where to copy these files? I suspect its a bit more than copy/paste into a directory.

Thanks in advance for the help.
 
Joined
Jan 7, 2015
Messages
1,155
You tell the webserver where these files are located in the http-vhost file. Here is mine for an example. This assumes you are running Apache. You might also have to allow this file to be read in the main httpd.conf file also located in the same directory below.

File locations, you can put your SSL files in this directory /usr/local/etc/apache24
/usr/local/etc/apache24/httpd.conf
Pertinent block (uncomment)
# Virtual hosts
Include etc/apache24/httpd-vhosts.conf

/usr/local/etc/apache24/httpd-vhosts.conf
Pertinent block from the vhost file for an example.

<VirtualHost *:443>
ServerAdmin admin@domain.org
DocumentRoot "/usr/local/www/nextcloud"
ServerName nextcloud.domain.org
SSLEngine on
SSLCertificateFile /usr/local/etc/letsencrypt/live/domain.org/cert.pem
SSLCertificateKeyFile /usr/local/etc/letsencrypt/live/domain.org/privkey.pem
SSLCertificateChainFile /usr/local/etc/letsencrypt/live/domain.org/chain.pem
CustomLog /media/download/nextcloud/nextcloud.log combined
ErrorLog /media/download/nextcloud/nextcloud.log
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
</IfModule>
</VirtualHost>
 

asw2012

Contributor
Joined
Dec 17, 2012
Messages
182
Joined
Jan 7, 2015
Messages
1,155
Good stuff!
 
Top