I’m working with Traefik v.2.2.1 and I’m just trying to properly install Nextcloud 19.0.1.
This is my configuration
docker-compose.yml
version: '3.8'
services:
# The main app
nextcloud:
image: nextcloud
networks:
- default
- proxy
volumes:
# Main folder, needed for updating
- html:/var/www/html
# installed / modified apps
- custom_apps:/var/www/html/custom_apps
# local configuration
- config:/var/www/html/config
# actual data of your Nextcloud!!!!
- data:/var/www/html/data
# Themes and branding
- themes:/var/www/html/themes/
restart: always
depends_on:
- db
- redis
environment:
- POSTGRES_HOST=${POSTGRES_HOST}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
# - NEXTCLOUD_ADMIN_USER=${NEXTCLOUD_ADMIN_USER}
# - NEXTCLOUD_ADMIN_PASSWORD=${NEXTCLOUD_ADMIN_PASSWORD}
- REDIS_HOST=${REDIS_HOST}
- REDIS_HOST_PORT=${REDIS_HOST_PORT}
- REDIS_HOST_PASSWORD=${REDIS_HOST_PASSWORD}
- NEXTCLOUD_TRUSTED_DOMAINS=nextcloud.example.org
- OVERWRITEPROTOCOL=https
labels:
traefik.enable: true
traefik.http.routers.nextcloud.rule: Host(`nextcloud.example.org`)
traefik.http.routers.nextcloud.entrypoints: websecure
traefik.http.routers.nextcloud.tls.certresolver: tlsleresolver
traefik.http.routers.nextcloud.middlewares: nextcloud-redirectregex,nc-header
# Custom middleware for Cal/Cardav routing
traefik.http.middlewares.nextcloud-redirectregex.redirectRegex.permanent: true
traefik.http.middlewares.nextcloud-redirectregex.redirectRegex.regex: https://(.*)/.well-known/(card|cal)dav
traefik.http.middlewares.nextcloud-redirectregex.redirectRegex.replacement: https://$${1}/remote.php/dav/
# Custom middleware for headers
traefik.http.middlewares.nc-header.headers.stsSeconds: 15552001
# nextcloud is backed by postgres
db:
image: postgres
networks:
- default
restart: always
volumes:
- dbdata:/var/lib/postgresql/data/
environment:
- POSTGRES_HOST=${POSTGRES_HOST}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
# Redis is used to prevent file locking problems
redis:
image: redis:alpine
networks:
- default
command: redis-server --requirepass ${REDIS_HOST_PASSWORD}
volumes:
- redisdata:/data
volumes:
html:
custom_apps:
config:
data:
themes:
dbdata:
redisdata:
networks:
proxy:
external: true
This is the resulting config.php
config.php
<?php
$CONFIG = array (
'htaccess.RewriteBase' => '/',
'memcache.local' => '\\OC\\Memcache\\APCu',
'apps_paths' =>
array (
0 =>
array (
'path' => '/var/www/html/apps',
'url' => '/apps',
'writable' => false,
),
1 =>
array (
'path' => '/var/www/html/custom_apps',
'url' => '/custom_apps',
'writable' => true,
),
),
'memcache.distributed' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => 'redis',
'password' => 'nextcloud',
'port' => 6379,
),
'overwriteprotocol' => 'https',
'instanceid' => 'oc9vg2zt2yoi',
'passwordsalt' => 'XXX/XXX/XX',
'secret' => XXX',
'trusted_domains' =>
array (
0 => 'nextcloud.example.org',
),
'datadirectory' => '/var/www/html/data',
'dbtype' => 'pgsql',
'version' => '19.0.1.1',
'overwrite.cli.url' => 'https://nextcloud.example.org',
'dbname' => 'nextcloud',
'dbhost' => 'db',
'dbport' => '',
'dbtableprefix' => 'oc_',
'dbuser' => 'oc_admin',
'dbpassword' => 'XXX',
'installed' => true,
);
After the installation, I can get the installation page at https://nextcloud.example.org. When I sign-up with the admin account, I install default apps.
Now, if I try to load a MS Word document and then to open in up with the app Collabora Online, I get:
Connection to server lost
Looking into it, it seems like the problem is related to an HTTP GET to the URL http://nextcloud.example.org/custom_apps/richdocumentscode/proxy.php?status that is blocked because it does not use https (even if I set OVERWRITEPROTOCOL=https
)
Why does this happen and how can I fix it up?