1. The problem I’m having:
I’m trying to reverse proxy a docker image that is set up with network_mode: wg-easy.
My goal is to require a vpn tunnel for accessing certain dockers. I’ve been having some difficulties in doing that, until i discovered that I could use network_mode: wg-easy.
I can now access those services from a browser by typing 172.23.0.7:.
I found the ip by browsing through portainer.
Because I want to be able to access wg-easys gui, I’m running that on the same docker network as caddy.
I figured, since wg-easy is running on the same network as caddy, I could access the dockers running through wg-easy by adding:
example.com {
reverse_proxy memos:172.23.0.7:5230
}
In the caddyfile. However, that does not work.
Obviously, I barely know anything about linux/servers/docker, so I’m surprised I’ve gotten this far.
Hopefully there is an obvious solution to this.
I apologize for editing my domains, but I’m a bit paranoid. I really don’t see how they are relevant.
2. Error messages and/or full log output:
curl: (6) Could not resolve host: notes.domain.com
3. Caddy version:
v2.9.1 h1:OEYiZ7DbCzAWVb6TNEkjRcSCRGHVoZsJinoDR/n9oaY=
4. How I installed and ran Caddy:
docker compose
a. System environment:
Debian 12
Docker compose
b. Command:
docker compose up -d
c. Service/unit/compose file:
services:
caddy:
image: caddy:latest
container_name: caddy
hostname: caddy
restart: unless-stopped
env_file: .env
ports:
- "80:80"
- "443:443"
- "443:443/udp"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
# - ./site:/srv
- caddy_data:/data
- caddy_config:/config
networks:
default:
name: caddyNet
#external: true
volumes:
caddy_data:
caddy_config:
d. My complete Caddy config:
navi.domain.com {
reverse_proxy navidrome:4533
}
tandoor.domain {
reverse_proxy web_recipes:8080
}
vpn.domain.com {
reverse_proxy wg-easy:51821
}
d.domain.com {
reverse_proxy homepage:3000
basic_auth {
# Username "Bob", password "hiccup"
Bob $2a$14$Zkx19XLiW6VYouLHR5NmfOFU0z2GTNmpkT/5qqR7hx4IjWJPDhjvG
}
}
p.domain.com {
reverse_proxy portainer:9000
}
note.domain.com {
reverse_proxy memos:172.18.0.0/16:5230
}