I’m working on setting up a NextCloud instance behind a reverse proxy on a TrueNAS system, running the latest version (12.0-U8.1, as of this posting). I’ve made a lot of progress so far - here’s what’s working:
TrueNAS is up and running.
Caddy server is up at 10.0.0.241
gjschaller.homeftp.net is pointing to my router, ports are forwarded to Caddy instance acting as the Proxy Caddy server is serving HTML without issue when the domain is browsed
Nextcloud is up and running at 10.0.0.242
I am able to access Nextcloud by browsing to the IP address via http, https is not enabled.
Where I am running into an issue:
I’ve done a bunch of legwork on the TrueNAS forums getting as far as I could, but I suspect at this point that the issue is my Nextcloud config. My current, working config is below - what do I need to add to it, to make it viewable via a reverse proxy running at 10.0.0.241, with the domain
gjschaller.homeftp.net associated with it?
$CONFIG = array (
'passwordsalt' => '(Redacted)',
'secret' => '(Redacted)',
0 => 'localhost',
1 => '10.0.0.242',
'datadirectory' => '/mnt/files',
'dbtype' => 'mysql',
'version' => '220.127.116.11',
'overwrite.cli.url' => 'http://localhost',
'dbname' => 'nextcloud',
'dbhost' => 'localhost:/tmp/mysql.sock',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'nextcloud',
'dbpassword' => '(Redacted)',
'installed' => true,
'instanceid' => '(Redacted)',
'logtimezone' => 'America/New_York',
'default_phone_region' => 'US',
'log_type' => 'file',
'logfile' => '/var/log/nextcloud/nextcloud.log',
'loglevel' => '2',
'logrotate_size' => '104847600',
'memcache.local' => '\\OC\\Memcache\\APCu',
You are missing the required support template. Please fill this form out and edit into your post.
Are you able to access your nc by ip?
You must add the subdomain url you want to use in Trusted domains. Note how it is missing from there.
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 trusted_domains entry in your config/config.php. The initial config would look like the following:
0 => '192.168.0.29',
To add a new domain just add new entries by ap…
This will give us the technical info and logs needed to help you! Thanks.
i’d rather ask that question on a TrueNAS / FreeBSD / Caddy-Forum.
I did, and they referred me to here.
Your Nextcloud config.php configuration should look something like this for your reverse proxy to work correctly.
0 => ‘Domain Name’,
1 => ‘Nextcloud Server IP’,
2 => ‘Reverse Proxy Server IP’,
‘trusted_proxies’ => ‘Reverse Proxy Server IP’,
‘overwriteprotocol’ => ‘https’,
‘overwritehost’ => ‘Domain Name’,
‘overwritecondaddr’ => ‘^00.00.000.00$’, <---- This is the reverse proxy IP broken down.
0 => ‘X-Forwarded-For’,
1 => ‘HTTP_X_FORWARDED_FOR’,
‘overwrite.cli.url’ => ‘ https://Domain Name/nextcloud’,
Here is the link for reference.
good gawd! Well I think it could turn out to be difficult to find someone setting up caddy for you. But well, you’re here so let’s hope the best.
Have you searched the forum for caddy setups already?
I got some additional (late) feedback from the TrueNAS forums - I’ll try a mix of what’s here, and what’s there, and report back if successful.
Could you please link over the truenas forum posts so we can follow along.
Can you please link the Caddy post.
I’m both in the process of moving my domain to a new registrar, and about to leave for a week’s vacation - I’ll follow up on this once I’m back online and can properly update my original post.
For documentation purposes, I am abandoning this attempt, and making a new one using a sub-domain instead of a directory. I’ll start a new thread if I run into issues.