Sure, here’s the nextcloud caddyfile on pastebin, it’s also here for convenience :
Nextcloud Caddyfile
{
# debug
#acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
email @email.com
# default_sni nextcloud domain com
}
nextcloud. domain {
root * /usr/local/www/nextcloud
file_server
log {
output file /var/log/nextcloud. domain .log
}
php_fastcgi 127.0.0.1:9000 {
env front_controller_active true
}
header {
# enable HSTS
# Strict-Transport-Security max-age=31536000;
}
# client support (e.g. os x calendar / contacts)
redir /.well-known/carddav /remote.php/dav 301
redir /.well-known/caldav /remote.php/dav 301
redir /.well-known/webfinger /index.php/.well-known/webfinger 301
redir /.well-known/nodeinfo /index.php/.well-known/nodeinfo 301
# Required for legacy
@notlegacy {
path *.php
not path /index*
not path /remote*
not path /public*
not path /cron*
not path /core/ajax/update*
not path /status*
not path /ocs/v1*
not path /ocs/v2*
not path /updater/*
not path /ocs-provider/*
not path */richdocumentscode/proxy*
}
rewrite @notlegacy /index.php{uri}
# .htaccess / data / config / ... shouldn't be accessible from outside
@forbidden {
path /.htaccess
path /data/*
path /config/*
path /db_structure
path /.xml
path /README
path /3rdparty/*
path /lib/*
path /templates/*
path /occ
path /console.php
}
respond @forbidden 404
}
And there’s the nextcloud config.php file on pastebin too,
and here for convenience if needed :
nextcloud config.php
<?php
$CONFIG = array (
'passwordsalt' => 'xx',
'secret' => 'xx',
'trusted_domains' =>
array (
0 => 'localhost',
1 => 'nextcloud. domain .click',
2 => '192.168.1.36',
),
'datadirectory' => '/mnt/files',
'dbtype' => 'mysql',
'version' => '29.0.1.1',
'overwrite.cli.url' => 'https: //nextcloud. domain .click/',
'dbname' => 'nextcloud',
'dbhost' => 'localhost:/var/run/mysql/mysql.sock',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'nextcloud',
'dbpassword' => 'MBRFvoQ52W7FSigMlnFnEA==',
'installed' => true,
'instanceid' => 'ocf0wn0s19o6',
'logtimezone' => 'Europe/xx',
'default_phone_region' => 'US',
'log_type' => 'file',
'logfile' => '/var/log/nextcloud/nextcloud.log',
'loglevel' => '2',
'logrotate_size' => '104847600',
'memcache.local' => '\\OC\\Memcache\\APCu',
'redis' =>
array (
'host' => '/var/run/redis/redis.sock',
'port' => 0,
),
'memcache.distributed' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'overwritehost' => 'nextcloud. domain .click',
'overwriteprotocol' => 'https',
'htaccess.RewriteBase' => '/',
'trusted_proxies' =>
array (
1 => '127.0.0.1',
),
'maintenance_window_start' => 5,
'mail_from_address' => 'xx',
'mail_smtpmode' => 'smtp',
'mail_sendmailmode' => 'smtp',
'mail_domain' => 'xxx',
'maintenance' => false,
'theme' => '',
);
I used Let’s encrypt, first with the staging certificate, then with the normal (which was working on my previous setup without the dedicated caddy jail
# acme_ca https://acme-staging-v02.api.letsencrypt.org/directory|
acme_ca https://acme-v02.api.letsencrypt.org/directory|
So I own my domain name (here : nextcloud. domain .com for this example), the DNS is setup and works (it was working on the previous setup too, and works on Plex and the static html pages), and I have ports 80 and 443 open. and i did that config before running danb35’s script, according to his guide on github, § usage - letsencrypt and usage - installation.
When I ran the script, I used exactly these parameters :
JAIL_IP="192.168.1.36"
DEFAULT_GW_IP="192.168.1.1"
POOL_PATH="/mnt/Nextcloud"
TIME_ZONE="Europe/..."
HOST_NAME="nextcloud. domain .com"
STANDALONE_CERT=1
CERT_EMAIL="myemail@..."
I hope that helps, and i am really grateful for your help
good night