Can't access Nextcloud AiO locally with DNS rewrite

Nextcloud AiO version : 8.0.0

Hello, I’m experiencing some issue with my local Nextcloud AiO instance. In particular I can’t access locally through DNS rewrite (done by Adguard Home that redirect all traffic from *.example.com to my NAS local IP).
I can confirm that the same setup work for other container but unfortunately I get a ERR_CERT_AUTHORITY_INVALID when I open nextcloud URL

I confirm that outsite the DNS rewrite the container works correctly, also I’m using Cloudflare origin certificate for TLS

I hope that you can help me.

I attach the docker-compose.yml of both nextcloud AiO and Caddy.


Nextcloud AiO

services:
  nextcloud-aio-mastercontainer:
    image: nextcloud/all-in-one:latest
    restart: unless-stopped
    container_name: nextcloud-aio-mastercontainer
    volumes:
      - nextcloud_aio_mastercontainer:/mnt/docker-aio-config
      - /var/run/docker.sock:/var/run/docker.sock:ro
    ports:
      - 8080:8080
    environment:
      - NEXTCLOUD_DATADIR=${MAIN_DISK}/data/nextcloud_data
      - NEXTCLOUD_MOUNT=/srv
      - APACHE_PORT=11000
      - APACHE_IP_BINDING=127.0.0.1
      - SKIP_DOMAIN_VALIDATION=true
    labels:
      caddy: https://cloud.example.com:443
      caddy.reverse_proxy: "localhost:11000"
      caddy.header: "Strict-Transport-Security max-age=31536000;"
      caddy.tls: "/certificate/example.com.pem /certificate/example.com.key"
    
volumes:
  nextcloud_aio_mastercontainer:
    name: nextcloud_aio_mastercontainer

Caddy
services:
  caddy:
    image: lucaslorentz/caddy-docker-proxy
    container_name: caddy
    network_mode: host
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ${MAIN_DISK}/data/caddy:/data/caddy
      - ./cert:/certificate
    restart: unless-stopped

Hi, can you follow all-in-one/reverse-proxy.md at main · nextcloud/all-in-one · GitHub?

Hello, I solved the issue by myself.
It wasn’t related to Nextcloud itself, but rather due to a problem with Cloudflare Origin certificates not being able to be validated outside the Cloudflare proxy.
I probably had some cached DNS records that made me think the problem was only with Nextcloud.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.