TLS internal at servers level

1. The problem I’m having:

Is it possible to use TLS internal module in global options (at servers level) ?

I tried to achieve it, but I get an error log.

I would like to use tls internal for all host using a specific server (:443) instead of use tls internal in each block

2. Error messages and/or full log output:

logger=admin.api msg=request error error=loading config: loading new config: loading http app module: provision http: it is unnecessary to specify the TLS listener wrapper in the first position because that is the default status_code=400

3. Caddy version:

v2.7.6

4. How I installed and ran Caddy:

a. System environment:

Docker

b. Command:

docker compose up -d

c. Service/unit/compose file:

caddy:
    container_name: "caddy"
    image: "<registry>/caddy-with-google-domains-dns:2.7.6"
    networks:
      metrics:
      proxy:
      vlan:
        ipv4_address: <ip>
    volumes:
      - "<path>/caddy/Caddyfile:/etc/caddy/Caddyfile"
      - "<path>/caddy/config:/config"
      - "<path>/caddy/data:/data"

d. My complete Caddy config:

{
        admin :2019
        email contact@domain.me
        acme_dns <provider> <token>
        servers :443 {
               listener_wrappers {
                       tls internal
               }
               metrics
        }
        servers {
               metrics
        }
}

##### EXTERNAL #####

abc.domain.me:12443 {
        reverse_proxy abc:5000
}

def.domain.me:12443 {
        @public not {
                path /admin
                path /admin/*
        }
        route {
                reverse_proxy @public def:8080
                respond 401
        }
}

##### INTERNAL #####

ghi.otherdomain.me {
        reverse_proxy ghi:3000
}

jkl.otherdomain.me {
        reverse_proxy jkl:9090
}

5. Links to relevant resources:

No. See the docs for what servers accepts: Global options (Caddyfile) — Caddy Documentation

The tls directive is a directive, therefore it must be used inside of a site block. See Caddyfile Concepts — Caddy Documentation

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