Can't get caddy to work. All subdomains show "This site cannot be reached" in browser

1. The problem I’m having:

I got Caddy up and running on my Mac last night but this morning it’s stopped working. All my subdomains give me this error in the browser:

This site can’t be reached
https://abs.customdomain.xyz/ is unreachable.
ERR_ADDRESS_UNREACHABLE

2. Error messages and/or full log output:

{"level":"info","ts":1681389082.1695204,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":"caddyfile"}
{"level":"info","ts":1681389082.1711106,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]}
{"level":"info","ts":1681389082.171347,"logger":"http","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":443}
{"level":"info","ts":1681389082.1713643,"logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
{"level":"info","ts":1681389082.1715872,"logger":"http","msg":"enabling HTTP/3 listener","addr":":443"}
{"level":"info","ts":1681389082.1716592,"msg":"failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB). See https://github.com/quic-go/quic-go/wiki/UDP-Receive-Buffer-Size for details."}
{"level":"info","ts":1681389082.1717482,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0x40000fd2d0"}
{"level":"debug","ts":1681389082.1717572,"logger":"http","msg":"starting server loop","address":"[::]:443","tls":true,"http3":true}
{"level":"info","ts":1681389082.1717827,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
{"level":"info","ts":1681389082.1718285,"logger":"tls","msg":"cleaning storage unit","description":"FileStorage:/data/caddy"}
{"level":"debug","ts":1681389082.1718569,"logger":"http","msg":"starting server loop","address":"[::]:80","tls":false,"http3":false}
{"level":"info","ts":1681389082.171864,"logger":"http.log","msg":"server running","name":"remaining_auto_https_redirects","protocols":["h1","h2","h3"]}
{"level":"info","ts":1681389082.1718667,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["portainer.customdomain.xyz","abs.customdomain.xyz"]}
{"level":"debug","ts":1681389082.172671,"logger":"tls","msg":"loading managed certificate","domain":"portainer.customdomain.xyz","expiration":1689064108,"issuer_key":"acme-v02.api.letsencrypt.org-directory","storage":"FileStorage:/data/caddy"}
{"level":"debug","ts":1681389082.17287,"logger":"tls.cache","msg":"added certificate to cache","subjects":["portainer.customdomain.xyz"],"expiration":1689064108,"managed":true,"issuer_key":"acme-v02.api.letsencrypt.org-directory","hash":"e12dcc594bf5e46b07b8e7375fe1e2e96712ba15983cc7fc75b2a8934c53271c","cache_size":1,"cache_capacity":10000}
{"level":"debug","ts":1681389082.172912,"logger":"events","msg":"event","name":"cached_managed_cert","id":"50917f63-ec25-400b-8885-23bd87146a8e","origin":"tls","data":{"sans":["portainer.customdomain.xyz"]}}
{"level":"info","ts":1681389082.1730254,"logger":"tls","msg":"finished cleaning storage units"}
{"level":"debug","ts":1681389082.1732082,"logger":"tls","msg":"loading managed certificate","domain":"abs.customdomain.xyz","expiration":1689064897,"issuer_key":"acme-v02.api.letsencrypt.org-directory","storage":"FileStorage:/data/caddy"}
{"level":"debug","ts":1681389082.1734586,"logger":"tls.cache","msg":"added certificate to cache","subjects":["abs.customdomain.xyz"],"expiration":1689064897,"managed":true,"issuer_key":"acme-v02.api.letsencrypt.org-directory","hash":"fa03cf85c7f54db4f44e3f5c744ab979937999d80c1fbf28ec4264dc3480a77a","cache_size":2,"cache_capacity":10000}
{"level":"debug","ts":1681389082.1735246,"logger":"events","msg":"event","name":"cached_managed_cert","id":"2d63d7a4-cf82-4bda-9eb6-0082afc3d322","origin":"tls","data":{"sans":["abs.customdomain.xyz"]}}
{"level":"info","ts":1681389082.1736727,"msg":"autosaved config (load with --resume flag)","file":"/config/caddy/autosave.json"}
{"level":"info","ts":1681389082.1736853,"msg":"serving initial configuration"}

3. Caddy version:

v2.6.4

4. How I installed and ran Caddy:

Docker compose

a. System environment:

Docker compose

b. Command:

docker compose up -d

c. Service/unit/compose file:

version: "3.9"

services:
  audiobookshelf:
     image: ghcr.io/advplyr/audiobookshelf:latest
     container_name: audiobookshelf
     networks:
      - caddy
     ports:
       - 13378:80
     volumes:
       - ~/Media/Audiobooks:/audiobooks
       - ~/Media/Podcasts:/podcasts
       - ~/Media/Config:/config
       - ~/Media/Metadata:/metadata
     restart: always

  caddy:
    image: caddy:latest
    container_name: caddy
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./caddy/Caddyfile:/etc/caddy/Caddyfile:ro
      - caddy_data:/data
      - caddy_config:/config
    restart: always
    networks:
      - caddy

  portainer:
    image: portainer/portainer-ce:latest
    container_name: portainer
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./portainer/portainer-data:/data
    networks:
      - caddy
    ports:
      - 9000:9000

volumes:
  caddy_data:
  caddy_config:

networks:
  caddy:
    external: true

d. My complete Caddy config:

portainer.customdomain.xyz {
	reverse_proxy portainer:9000
}

abs.customdomain.xyz {
	reverse_proxy audiobookshelf:80
}

5. Links to relevant resources:

Make sure your firewall isn’t blocking the connection.

This isn’t a problem with Caddy specifically, it’s a problem with your networking, somewhere between your client and your server.

I’ve tried turning off the firewall, my adblocker, and VPN. None of that worked.

My Computers IP had changed and I needed to update it in my router port forwarding. I used this command to get the new IP:
ifconfig | grep "inet " | grep -v 127.0.0.1 | cut -d ' ' -f2

1 Like

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