Wow that was fast. Thank you for the fast reply. Unfortunately I’m on my way to work. But here you can see my Config. With the Parts commentet out I could reach the nextcloud in my internal network. But as soon I put the reverse part in the caddyfile I can’t connect to my nextcloud. I would mentioned that the caddy and the nextcloud are in the same jail
Code:
Caddyfile
{
# debug
# default_sni nextcloud
# https_port 442
}
192.168.178.XXX {
root * /usr/local/www/nextcloud
file_server
tls internal
# reverse_proxy 127.0.0.1:442
log {
output file /var/log/192.168.178.XXX.log
}
php_fastcgi 127.0.0.1:9000 {
env front_controller_active true
}
tls /usr/local/etc/pki/tls/certs/fullchain.pem /usr/local/etc/pki/tls/private/privkey.pem
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
# .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
}
Code:
Nextcloud
<?php
$CONFIG = array (
'passwordsalt' => deleted
'secret' => deleted
'trusted_domains' =>
array (
0 => 'localhost',
1 => '192.168.178.XXX',
2 => 'example.com',
3 => '127.0.0.1',
),
'datadirectory' => '/mnt/files',
'dbtype' => 'mysql',
'version' => '27.1.4.1',
'overwrite.cli.url' => 'https://192.168.178.XXX/',
'dbname' => 'nextcloud',
'dbhost' => 'localhost:/var/run/mysql/mysql.sock',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'nextcloud',
'dbpassword' => deleted
'installed' => true,
'instanceid' => deleted
'logtimezone' => 'Europe/Berlin',
'default_phone_region' => 'DE',
'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' => '192.168.178.XXX',
'overwriteprotocol' => 'https',
'htaccess.RewriteBase' => '/',
'trusted_proxies' =>
array (
1 => '192.168,178.XXX',
2 => 'localhost',
),
);