Has anyone had any luck setting this up behind a reverse proxy (I'm using Nginx proxy manager)? I've search the thread and found it referenced but no definitive answer.
I ran the script with NO_CERT using the nextcloud jail IP as the hostname, which worked and I could access nextcloud from the IP. With the proxy set up I either get a 'too many redirects' error, or a blank page loads. I think I need edit the caddy file but am unsure what is needed. Any help would be greatly appreciated.
Here is my config.php
and my caddyfile
I ran the script with NO_CERT using the nextcloud jail IP as the hostname, which worked and I could access nextcloud from the IP. With the proxy set up I either get a 'too many redirects' error, or a blank page loads. I think I need edit the caddy file but am unsure what is needed. Any help would be greatly appreciated.
Here is my config.php
Code:
<?php $CONFIG = array ( 'passwordsalt' => 'abc123', 'secret' => 'abc123', 'trusted_domains' => array ( 0 => 'localhost', 1 => 'nextcloud local IP', 2 => 'reverse proxy local IP', 3 => 'cloud.fqdn.com', ), 'datadirectory' => '/mnt/files', 'dbtype' => 'mysql', 'version' => '22.2.0.2', 'overwrite.cli.url' => 'https://cloud.fqdn.com/', 'forwarded_for_headers' => 'HTTP_X_FORWARDED_FOR', 'dbname' => 'nextcloud', 'dbhost' => 'localhost:/tmp/mysql.sock', 'dbport' => '', 'dbtableprefix' => 'oc_', 'mysql.utf8mb4' => true, 'dbuser' => 'nextcloud', 'dbpassword' => 'abc123', 'installed' => true, 'instanceid' => 'ocwk5qcyzdxm', 'logtimezone' => 'Europe/London', 'default_phone_region' => 'GB', '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' => 'cloud.fqdn.com', 'overwriteprotocol' => 'https', 'overwriteconaddr' => 'reverse proxy local IP' 'htaccess.RewriteBase' => '/', 'trusted_proxies' => 'reverse proxy local IP', 'updater.secret' => 'abc123.', 'maintenance' => false, 'theme' => '', );
and my caddyfile
Code:
{ # debug } 192.168.1.x:80 { root * /usr/local/www/nextcloud file_server log { output file /var/log/192.168.1.x.log format single_field common_log } php_fastcgi 127.0.0.1:9000 { env front_controller_active true } # 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 }