Nextcloud AIO with Traefik setup wrong communication

Hello !

I tried to install Nextcloud AIO, which seems to me quite interesting in its “global” approach.

My dedicated machine runs under Ubuntu 20.04.3, with a reverse proxy under Traefik 2.8.3.
The problem is that there seems to be a communication problem between this reverse proxy and the Apache container.
Here is the “Services” section of traefik_dynamic.yaml file which I use to instantiate the different containers.

## SERVICES
  services:
    nextcloud:
      loadBalancer:
        servers:
        - url: "http://nextcloud-aio-mastercontainer:8080

and, this is the docker-compose.yml (in entire)

version: "3.6"

volumes:
  nextcloud_aio_mastercontainer:
    name: nextcloud_aio_mastercontainer

services:
  nextcloud:
    image: nextcloud/all-in-one:latest 
    restart: always
    container_name: nextcloud-aio-mastercontainer 
    volumes:
      - nextcloud_aio_mastercontainer:/mnt/docker-aio-config
      - /var/run/docker.sock:/var/run/docker.sock:ro
    ports:
      - 8090:8080
    environment: 
      - APACHE_PORT=11000
      - APACHE_IP_BINDING=127.0.0.1
      - NEXTCLOUD_DATADIR=/srv/docker_stack/nextcloud/data 
      - NEXTCLOUD_MOUNT=/srv/
      - NEXTCLOUD_UPLOAD_LIMIT=10G
      - NEXTCLOUD_MAX_TIME=3600 
      - SKIP_DOMAIN_VALIDATION=true
      - TRUSTED_PROXIES=172.18.0.0/16
      - NEXTCLOUD_TRUSTED_DOMAINS=nextcloud.xxx.fr
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=traefik"
      - "traefik.http.middlewares.nextcloud_redirect.redirectregex.permanent=true"
      - "traefik.http.middlewares.nextcloud_redirect.redirectregex.regex=^https://(.*)/.well-known/(card|cal)dav"
      - "traefik.http.middlewares.nextcloud_redirect.redirectregex.replacement=https://$${1}/remote.php/dav/"
      - "traefik.http.middlewares.nextcloud-https.redirectscheme.scheme=https"
      - "traefik.http.routers.nextcloud.entrypoints=http"
      - "traefik.http.routers.nextcloud.rule=Host(`nextcloud.xxx.fr`)"
      - "traefik.http.routers.nextcloud.entrypoints=https"
      - "traefik.http.routers.nextcloud.tls=true"
      - "traefik.http.routers.nextcloud.tls.certresolver=cloudflare"
      - "traefik.http.routers.nextcloud.service=nextcloud@file"
      - "traefik.http.services.nextcloud.loadbalancer.servers.port=8090"
    networks:
      - traefik

networks:
  traefik:
    external: true

The problem is that when I type the URL I am most often entitled to a 400 error.

image

if I change the port (11000, Apache’s), or even the container, I change the error and go to a 502 Bad Gateway.

In short, after 5 hours of research, I do not understand what is wrong with my configuration. Port ? Wrong container ?

It would be a joy to have a little help!

Hi, see all-in-one/reverse-proxy.md at main · nextcloud/all-in-one · GitHub