Nextcloud & Collabora => HTTPS for Local Domains on NanoPI R4S with Arambian ARM64

Hi Everybody,

I’m trying to set up Nextcloud with Collabora Office on my NanoPi R4S running Armbian, but I’m having trouble configuring the reverse proxy (nginx/Caddy) for HTTPS with local domains.
Current Setup:

Running via docker-compose.yml (shown below)

Without HTTPS, everything works: Collabora can open documents in Nextcloud's web UI

With HTTPS enabled, Collabora integration breaks

Added to /etc/hosts:
Copy

127.0.0.1 nextcloud.lan collabora.nextcloud.lan

What I Need:

HTTPS configuration for both services

Reverse proxy to local domains:

    Nextcloud: https://nextcloud.lan

    Collabora: https://collabora.nextcloud.lan

My docker-compose.yml (HTTP-only version):

networks:
network:
driver: bridge

volumes:
mariadb_config:
mariadb_data:
nextcloud_config:
nextcloud_data:

services:
collabora:
image: collabora/code
restart: unless-stopped
container_name: collabora
hostname: collabora
networks:
- network
ports:
- “9980:9980”
cap_add:
- MKNOD

nextcloud_db:
image: linuxserver/mariadb
restart: unless-stopped
container_name: nextcloud_db
hostname: nextcloud_db
networks:
- network
volumes:
- mariadb_config:/config
- mariadb_data:/data
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Moscow
- MYSQL_ROOT_PASSWORD=nextcloud
- MYSQL_DATABASE=nextcloud_db
- MYSQL_USER=nextcloud
- MYSQL_PASSWORD=nextcloud

nextcloud:
image: linuxserver/nextcloud
restart: unless-stopped
depends_on:
- nextcloud_db
- collabora
container_name: nextcloud
hostname: nextcloud
networks:
- network
ports:
- “8080:80”
volumes:
- nextcloud_config:/config
- nextcloud_data:/data
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
- NEXTCLOUD_UPLOAD_LIMIT=16G
- NEXTCLOUD_MAX_TIME=3600
- NEXTCLOUD_MEMORY_LIMIT=3G
- SKIP_DOMAIN_VALIDATION=true
- NEXTCLOUD_TRUSTED_DOMAINS=192.168.1.100

Key Questions:

How should I modify the docker-compose.yml to:

  • Enable HTTPS for both services?
  • Properly configure the reverse proxy for the local domains?
  • Set up valid SSL certificates for *.lan domains?

For Collabora:

  • What extra_params or environment variables are needed for HTTPS?
  • How to configure Nextcloud’s config.php for the Collabora HTTPS endpoint?

I’d prefer a solution using Caddy if possible, as it’s simpler for automatic HTTPS. Any working configuration examples would be greatly appreciated!

Thanks in advance for your help!

Viktor
WordPrress Developer
https://vm-project.pro