I, like everybody else, am trying out Caddy and stumbled upon an issue which, hopefully, can be resolved here. Unfortunately every other topic is using Caddy v2 but my case is for v1.0.3.
Currently I have a Windows Server with a secondary DNS cname record “testing-stuff.url-resolver.domain.local”. We shall call it machine B.
For machine A I have a CentOS 7 which runs Docker 1.13.1 - due to sensitivity of the machine A I am trying to move certain production containers to the new machine B.
The second DNS record purpose is to avoid tedious reconfiguration should I decide to switch machine B to another host. That way DNS record gets reconfigured on another machine but Caddy configuration still points to the record.
Caddy v1.0.3 (abiosoft/caddy:1.0.3-no-stats) is currently running on Portainer v1.22.1 with pretty much everything default but ports being 80 on the host and 2015 on the container.
Caddyfile looks like this:
First two links point to Docker host (machine A) which houses certain containers and where portainer resides. The third link should do the same although it points from machine B to a docker container deployed on machine A.
The test is with Postman. If I enter “testing-stuff.url-resolver.domain.local:20421” with GET method everything works as intended. Although if I enter “testing-stuff.url-resolver.domain.local” I get 502 Bad Gateway. The idea is to map “testing-stuff.url-resolver.domain.local” to container 172.18.0.4:20421 without specifying port in the URL.
Would appreciate any ideas on how to solve given issue. Much appreciated.