1. Caddy version (caddy version
):
v2.4.5
2. How I run Caddy:
a. System environment:
ubuntu, docker
b. Command:
docker-compose up
c. Service/unit/compose file:
version: "3.7"
services:
caddy:
image: caddy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- $PWD/Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
volumes:
caddy_data:
external: true
caddy_config:
d. My complete Caddyfile or JSON config:
# The Caddyfile is an easy way to configure your Caddy web server.
#
# Unless the file starts with a global options block, the first
# uncommented line is always the address of your site.
#
# To use your own domain name (with automatic HTTPS), first make
# sure your domain's A/AAAA DNS records are properly pointed to
# this machine's public IP, then replace ":80" below with your
# domain name.
media.ryanrambharose.dev {
# Set this path to your site's directory.
#root * /usr/share/caddy
# Enable the static file server.
#file_server
# Another common task is to set up a reverse proxy:
reverse_proxy jellyfin:8096
# Or serve a PHP site through php-fpm:
# php_fastcgi localhost:9000
}
bitwarden.ryanrambharose.dev {
reverse_proxy bitwarden:8013
}
portainer.ryanrambharose.dev {
reverse_proxy portainer:9001
}
chat.ryanrambharose.dev {
reverse_proxy synapse:8008
}
chat.ryanrambharose.dev:8448 {
reverse_proxy synapse:8008
}
irc.ryanrambharose.dev {
reverse_proxy thelounge:9000
}
pihole.ryanrambharose.dev {
reverse_proxy pihole:8009
}
3. The problem I’m having:
Run Caddy with Dockstarter and Docker
4. Error messages and/or full log output:
caddy_1 | {“level”:“error”,“ts”:1636127149.278481,“logger”:“http.log.error”,“msg”:“dial tcp: lookup portainer on 127.0.0.11:53: no such host”,“request”:{“remote_addr”:“174.92.13.211:51687”,“proto”:“HTTP/2.0”,“method”:“GET”,“host”:“portainer.ryanrambharose.dev”,“uri”:"/",“headers”:{“User-Agent”:[“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36”],“Sec-Fetch-Site”:[“none”],“Sec-Fetch-Mode”:[“navigate”],“Sec-Fetch-User”:["?1"],“Cache-Control”:[“max-age=0”],“Sec-Ch-Ua”:["“Chromium”;v=“95”, “;Not A Brand”;v=“99"”],“Sec-Ch-Ua-Mobile”:["?0"],“Sec-Ch-Ua-Platform”:["“Windows”"],“Upgrade-Insecure-Requests”:[“1”],“Accept”:[“text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9”],“Sec-Fetch-Dest”:[“document”],“Accept-Encoding”:[“gzip, deflate, br”],“Accept-Language”:[“en-US,en;q=0.9”]},“tls”:{“resumed”:false,“version”:772,“cipher_suite”:4865,“proto”:“h2”,“proto_mutual”:true,“server_name”:“portainer.ryanrambharose.dev”}},“duration”:0.002577361,“status”:502,“err_id”:“26f9egj6t”,“err_trace”:“reverseproxy.statusError (reverseproxy.go:858)”}
5. What I already tried:
Instead of localhost I set it to the docker container name and port. I think the issue might be due to networks being different?