Nextcloud & Traefik (Docker) - 404 Page not found LAN / Local Address

Hi.

I really love using nextcloud. There is only one thing i can’t figure out myself - hope anybody else can help me.

I’m running three containers in docker (nextcloud, mariadb, traefik) and use a DDNS from No-Ip.
I can access domain.ddns.net (from outside my own network), but when i try to access the local ip 192.168.0.xx (from inside my network) i get a blank page with “404 page not found”.

Here are my docker-compose files, please let me know if you need to know anything else.
Thanks a lot!

Nextcloud & DB:

version: ‘3.3’

volumes:
  nextcloud-db:

services: 
  nextcloud-db:
    image: mariadb
    container_name: nextcloud-db
    command: --transaction-isolation=READ-COMMITTED --log-bin=ROW
    restart: always
    volumes:
      - nextcloud-db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=secret
      - MYSQL_PASSWORD=secret
      - MYSQL_DATABASE=secret
      - MYSQL_USER=secret
      - MYSQL_INITDB_SKIP_TZINFO=1 # Behebt die bekannten Startprobleme der Datenbank
    
  nextcloud-app:
    image: nextcloud
    container_name: nextcloud-app
    restart: always
    volumes: 
      - /var/docker/nextcloud/app:/var/www/html
      - /media/usbcloud:/usbdata
    links:
      - nextcloud-db
    labels:
      - "traefik.enable=true"
      - "traefik.http.middlewares.nextcloud-https.redirectscheme.scheme=https"
      - "traefik.http.routers.nextcloud-http.entrypoints=web"
      - "traefik.http.routers.nextcloud-http.rule=Host(`domain.ddns.net`)" 
      - "traefik.http.routers.nextcloud-http.middlewares=nextcloud-https@docker"
      - "traefik.http.routers.nextcloud.entrypoints=web-secure"
      - "traefik.http.routers.nextcloud.rule=Host(`domain.ddns.net`)" 
      - "traefik.http.routers.nextcloud.tls=true"
      - "traefik.http.routers.nextcloud.tls.certresolver=default"
      - "traefik.http.routers.nextcloud.middlewares=secHeaders@file"
      - "traefik.http.services.nextcloud.loadbalancer.server.port=80"
    networks:
      - traefik_proxy
      - default
    
networks:
  traefik_proxy:
    external:
      name: traefik_proxy
  default:
    driver: bridge

Traefik:

---
version: '3.7'

services:
  traefik:
    image: traefik:latest
    container_name: traefik
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /home/ack/docker/traefik/config:/etc/traefik
      - /etc/localtime:/etc/localtime
    # labels:
    #   - "traefik.enable=true"
    #   - "traefik.http.routers.api.rule=Host(`traefik.example.com`) && PathPrefix(`/dashboard`)" # Domainnamen anpassen!
    #   - "traefik.http.routers.api.entryPoints=dashboard"
    #   - "traefik.http.routers.api.rule=PathPrefix(`/api`) || PathPrefix(`/dashboard`)"
    #   - "traefik.http.routers.api.service=api@internal"
    #   - "traefik.http.routers.api.middlewares=api-auth"
    #   - "traefik.http.middlewares.api-auth.basicauth.users=user/pass" # Benutzer und Passwort generieren
    networks:
      - traefik_proxy
      - default
    ports:
      - "80:80"
      - "443:443"
      - "8180:8080"
    restart: always

networks:
  traefik_proxy:
    external:
      name: traefik_proxy
  default:
    driver: bridge

you told traefik to route the fqdn.

grafik

but not the ip address. according to the docs

should help.

Thanks a lot that helped me!

Anyway a bit annoying that my router does not support NAT loopback… that’s why i have to use the local ip and get a certificate error. Maybe time for a better router.

you could setup an internal DNS server resolving 192.168.0.xx to domain.ddns.net