iOS problems with NextCloud on docker and caddy

Hi everyone,

I have deployed nextcloud on my server, using caddy2 as reverse proxy. I am including my docker-compose below. Everything was working fine and when I turned https on, I lost access from my iphone devices. When I try to connect either from the NextCloud app or from safari, I get NSURLErrorDomain: cannot parse response.

I know it is related to the reverse proxy, and that there are solutions for nginx. Has anyone found a solution for this problem for Caddy?

Thanks!

services:
    proxy:
        image: wemakeservices/caddy-gen:latest
        container_name: proxy
        restart: on-failure
        depends_on:
            - service
        ports:
            - "80:80"
            - "443:443"
        volumes:
            - /var/run/docker.sock:/tmp/docker.sock:ro # Docker events
            - proxy_data:/data/caddy        

    drive:
        image: nextcloud:21.0.1
        container_name: drive
        depends_on:
            - drive-db
        restart: on-failure
        volumes:
            - drive_data:/var/www/html
        ports:
            - 9000:80
        environment:
            - MYSQL_HOST=drive-db
            - MYSQL_DATABASE=$DRIVE_DB_NAME
            - MYSQL_USER=$DRIVE_DB_USER
            - MYSQL_PASSWORD=$DRIVE_DB_PASS
        labels:
            virtual.host: drive.$PROXY_DOMAIN # Domain name the service should live under
            virtual.tls: $PROXY_EMAIL # Enable HTTPS


    # Database used by `drive` service
    drive-db:
        image: mariadb:10.5.9
        container_name: drive-db
        restart: on-failure
        volumes:
        - drive-db_data:/var/lib/mysql
        environment:
            - MYSQL_ROOT_PASSWORD=$DRIVE_DB_PASS_ADMIN
            - MYSQL_DATABASE=$DRIVE_DB_NAME
            - MYSQL_USER=$DRIVE_DB_USER
            - MYSQL_PASSWORD=$DRIVE_DB_PASS

I don’t know Caddy but I suspect for those who do, they will need to see how you have it configured.

Just based on your description it sounds like something is not right with the SSL configuration of the proxy.

All the caddy configuration is posted in my original message :slight_smile: