Hi,
I’m new to Docker (and to reverse proxy) and I’m trying to setup Caddy as a reverse proxy in front of Mailcow-Dockerized (mailcow-dockerized/docker-compose.yml at master · mailcow/mailcow-dockerized · GitHub).
Caddy is itself in a Docker container. It works to serve the simple website on the host, but I’m not able to configure it to serve as a reverse proxy the Mailcow Webui I have in another container. I get 502 Bad Gateway error.
All that is currently running in a CoreOS vm on my local machine and nothing is accessible from Internet for now.
I run Caddy with this command:
docker run -d --name caddy -e "CADDYPATH=/etc/caddycerts" -v $(pwd)/Caddyfile:/etc/Caddyfile -v $HOME/.caddy:/etc/caddycerts -p 80:80 -p 443:443 abiosoft/caddy
Here is what I currently have in the Caddyfile:
:80 {
root /srv/
proxy /mailcow 127.0.0.1:8080 {
transparent
}
}
What is wrong with what I do?
I already read many other 502 Bad Gateway related topics but could not figure out if the solution was in there, sorry.
Thank you!
Jean-Philippe