Can't set up reverse proxy

When running in Docker, localhost refers to this current container. So Caddy is trying to connect to a service within the same Docker container. That won’t work, because the only thing running in that container is Caddy.

Instead, you should use the container name of the thing you’re trying to proxy to. They need to be in the same Docker network. In this case, that would be prueba-jardinesecologicos. Also, you would proxy to the port of the internal service, i.e. 80 (not 3000).

So you would do this:

prueba.jardinesecologicos.com {
    reverse_proxy prueba-jardinesecologicos:80
}
2 Likes