Nextcloud + Collabora + Traefik: Could not establish connection to the Collabora Online server.

I create a Docker-Compose file like this, and when I connect Nextcloud with Collabora using Traefik Proxy, it errors. Has anyone encountered this issue before? Help me please;c

My docker-compose file:

services:
  traefik:
    build:
      context: ./traefik
      dockerfile: Dockerfile
    container_name: traefik
    command:
      - "--global.checknewversion=false"
      - "--global.sendanonymoususage=false"
      - "--log=true"
      - "--log.level=INFO"
      - "--entrypoints.http=true"
      - "--entrypoints.http.address=:80"
      - "--entrypoints.http.http.redirections.entrypoint.to=https"
      - "--entrypoints.http.http.redirections.entrypoint.scheme=https"
      - "--entrypoints.https=true"
      - "--entrypoints.https.address=:443"
      - "--certificatesresolvers.letsencrypt"
      - "--certificatesresolvers.letsencrypt.acme.storage=acme.json"
      - "--certificatesresolvers.letsencrypt.acme.email=webmaster@example.com"
      - "--certificatesresolvers.letsencrypt.acme.httpchallenge"
      - "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=http"
      - "--providers.docker"
      - "--providers.docker.watch=true"
      - "--providers.docker.exposedbydefault=false"
    ports:
      - target: 80
        published: 80
        protocol: tcp
      - target: 443
        published: 443
        protocol: tcp
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
    restart: always

  db:
    image: mariadb:10
    container_name: nextcloud_db
    volumes:
      - "db:/var/lib/mysql"
    environment:
      - "MARIADB_RANDOM_ROOT_PASSWORD=yes"
      - "MYSQL_DATABASE"
      - "MYSQL_USER"
      - "MYSQL_PASSWORD"
    restart: always

  redis:
    image: redis:6-alpine
    container_name: nextcloud_redis
    environment:
      - "TZ"
    restart: always

  msmtpd:
    image: crazymax/msmtpd:latest
    container_name: nextcloud_msmtpd
    env_file:
      - "./msmtpd.env"
    environment:
      - "TZ"
    restart: always

  nextcloud:
    build:
      context: ./nextcloud
      dockerfile: Dockerfile
    container_name: nextcloud
    depends_on:
      - db
      - redis
      - msmtpd
    volumes:
      - "nextcloud:/data"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.nextcloud.entrypoints=https"
      - "traefik.http.routers.nextcloud.rule=Host(`nextcloud.example.com`)"
      - "traefik.http.routers.nextcloud.middlewares=nextcloud-dav,nextcloud-wellknown"
      - "traefik.http.routers.nextcloud.tls=true"
      - "traefik.http.routers.nextcloud.tls.certresolver=letsencrypt"
      - "traefik.http.routers.nextcloud.tls.domains[0].main=nextcloud.example.com"
      - "traefik.http.services.nextcloud.loadbalancer.server.port=8000"
      - "traefik.http.middlewares.nextcloud-dav.replacepathregex.regex=^/.well-known/(card|cal)dav"
      - "traefik.http.middlewares.nextcloud-dav.replacepathregex.replacement=/remote.php/dav/"
      - "traefik.http.middlewares.nextcloud-wellknown.replacepathregex.regex=^(/.well-known.*)"
      - "traefik.http.middlewares.nextcloud-wellknown.replacepathregex.replacement=/index.php$$1"
    env_file:
      - "./nextcloud.env"
    environment:
      - "TZ"
      - "PUID"
      - "PGID"
      - "DB_TYPE=mysql"
      - "DB_HOST=db"
      - "DB_NAME=${MYSQL_DATABASE}"
      - "DB_USER=${MYSQL_USER}"
      - "DB_PASSWORD=${MYSQL_PASSWORD}"
      - "NEXTCLOUD_TRUSTED_DOMAINS=${NEXTCLOUD_TRUSTED_DOMAINS}"
    restart: always

  cron:
    build:
      context: ./nextcloud
      dockerfile: Dockerfile
    container_name: nextcloud_cron
    depends_on:
      - nextcloud
    volumes:
      - "nextcloud:/data"
    env_file:
      - "./nextcloud.env"
    environment:
      - "TZ"
      - "PUID"
      - "PGID"
      - "DB_TYPE=mysql"
      - "DB_HOST=db"
      - "DB_NAME=${MYSQL_DATABASE}"
      - "DB_USER=${MYSQL_USER}"
      - "DB_PASSWORD=${MYSQL_PASSWORD}"
      - "SIDECAR_CRON=1"
      - "CRON_PERIOD=*/5 * * * *"
    restart: always

  previewgen:
    build:
      context: ./nextcloud
      dockerfile: Dockerfile
    container_name: nextcloud_previewgen
    depends_on:
      - nextcloud
    volumes:
      - "nextcloud:/data"
    env_file:
      - "./nextcloud.env"
    environment:
      - "TZ"
      - "PUID"
      - "PGID"
      - "DB_TYPE=mysql"
      - "DB_HOST=db"
      - "DB_NAME=${MYSQL_DATABASE}"
      - "DB_USER=${MYSQL_USER}"
      - "DB_PASSWORD=${MYSQL_PASSWORD}"
      - "SIDECAR_PREVIEWGEN=1"
      - "PREVIEWGEN_PERIOD=0 * * * *"
    restart: always

  news_updater:
    build:
      context: ./nextcloud
      dockerfile: Dockerfile
    container_name: nextcloud_news_updater
    depends_on:
      - nextcloud
    volumes:
      - "nextcloud:/data"
    env_file:
      - "./nextcloud.env"
    environment:
      - "TZ"
      - "PUID"
      - "PGID"
      - "DB_TYPE=mysql"
      - "DB_HOST=db"
      - "DB_NAME=${MYSQL_DATABASE}"
      - "DB_USER=${MYSQL_USER}"
      - "DB_PASSWORD=${MYSQL_PASSWORD}"
      - "SIDECAR_NEWSUPDATER=1"
      - "NC_NEWSUPDATER_THREADS=10"
      - "NC_NEWSUPDATER_TIMEOUT=300"
      - "NC_NEWSUPDATER_INTERVAL=900"
      - "NC_NEWSUPDATER_LOGLEVEL=error"
    restart: always

  collabora:
    image: collabora/code
    container_name: nextcloud_collabora
    cap_add:
      - MKNOD
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.collabora.entrypoints=https"
      - "traefik.http.routers.collabora.rule=Host(`collabora.example.com`)"
      - "traefik.http.routers.collabora.tls=true"
      - "traefik.http.routers.collabora.tls.certresolver=letsencrypt"
      - "traefik.http.routers.collabora.tls.domains[0].main=collabora.example.com"
      - "traefik.http.services.collabora.loadbalancer.server.port=9980"
    environment:
      - "DONT_GEN_SSL_CERT=true"
      - "domain=nextcloud.example.com"
      - "extra_params=--disable-ssl"
      - "aliasgroup1=https://nextcloud.example.com"
    restart: always
  
volumes:
  db:
  nextcloud:

Hello @0x1ceKing, welcome to the Nextcloud community! :handshake:

what is your expectations using this hostname? you don’t own this domain (basically nobody can) so you can’t host anything there.

Hi, I’m a Cybersecurity Researcher and I’m trying to set up Nextcloud with Collabora and Mail locally for debugging purposes. I’m not very experienced with Docker, so I’d really appreciate any advice or guidance you can provide. Thanks u

it has nothing to do with Docker. example.com is an invalid domain. CODE integration requires valid certificates for full functionality - in most cases the easiest way is to use real domain and LE TLS certificates. review Collabora integration guide for details

I mean, technically you can use example.com locally.

To make it work, cloud.example.com and office.example.com need to resolve to the server’s IP address on all devices that require access. If you’re only testing from a few devices (e.g., your PC), you can add these domain names to each device’s local hosts file and point them to the server’s IP. However, since you don’t own example.com, you’ll likely be using self-signed certificates. In that case, you’ll also need to check the “Disable certificate verification” option.

Are you willing to share the topics you want to look at?

As a security expert, I expect you to know exactly what you need and what you want to achieve. Typically, you will want to have a very clear understanding in the area of your interest.