Timeout during connect (likely firewall problem)

OMG I just found it.

If the reverse proxy is running in a docker container, you can use the --network host option (or network_mode: host for docker-compose) when starting the reverse proxy container in order to connect the reverse proxy container to the host network. If that is not an option for you, you can alternatively instead of localhost use the ip-address that is displayed after running the following command on the host OS: ip a | grep "scope global" | head -1 | awk '{print $2}' | sed 's|/.*||' (the command only works on Linux)

Apparently I’m one that that’s not an option for.

I ran it and pull the ip address. I’m pretty confused since that’s not my IP address. I guess WSL has a different IP than windows and I have some studying on that to do on that.

Here’s my working config
Caddyfile

https://nextcloud.weme.wtf:443 {
        header Strict-Transport-Security max-age=31536000;
        reverse_proxy <WSL IP Address>:11000
}
https://weme.wtf:443 {
        header Strict-Transport-Security max-age=31536000;
        respond "weme.wtf test"
}

docker-compose.yml

services:
  caddy:
    image: caddy:alpine
    restart: unless-stopped
    container_name: caddy
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile
      - ./certs:/certs
      - ./config:/config
      - ./data:/data
      - ./sites:/srv
#    network_mode: "host" incompatible with docker-desktop for windows
    ports:
      - "80:80"
      - "443:443"

  nextcloud:
    image: nextcloud/all-in-one:latest
    restart: unless-stopped
    container_name: nextcloud-aio-mastercontainer
    ports:
      - "8080:8080"
    environment:
      - APACHE_PORT=11000
    volumes:
      - nextcloud_aio_mastercontainer:/mnt/docker-aio-config
      - //var/run/docker.sock:/var/run/docker.sock:ro
    depends_on:
      - caddy

volumes:
  nextcloud_aio_mastercontainer:
    name: nextcloud_aio_mastercontainer

Thanks for pointing out things to look at. Glad I can get some other services going.

1 Like