How to use bridge dns instead of IP address?

1. Output of caddy version:

I ran it into docker. caddy:2-alpine

2. How I run Caddy:

docker run --rm -i -t -p 80:80 -p 443:443 -v /data:/data -v $PWD/Caddyfile:/etc/caddy/Caddyfile caddy:2-alpine

a. System environment:

Docker version 20.10.17, build 100c701

b. Command:

docker run --rm -i -t -p 80:80 -p 443:443 -v /data:/data -v $PWD/Caddyfile:/etc/caddy/Caddyfile caddy:2-alpine

c. Service/unit/compose file:

d. My complete Caddy config:


https:// {

  tls {

  reverse_proxy {
    header_up Host {upstream_hostport}

3. The problem I’m having:

It succeed If I set Caddy Server’s IP Address as an A record for
But I want to provide a CNAME for our customer like And I set Caddy Server’s IP Address as an A record for And it failed when our customer set an CNAME to our

It succeed on:

It fails on:
A (Caddy Server IP)

4. Error messages and/or full log output:

curl -v

*   Trying
* Connected to ( port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* error:1408F10B:SSL routines:ssl3_get_record:wrong version number
* Closing connection 0
curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number

5. What I already tried:

6. Links to relevant resources:

Did you look at Caddy’s logs?

Yes, I checked the Caddy logs. There is no record about this.

I have just controlled. It works now. Thank you for your interest Francis.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.