How can i set protocols for one app in caddyfile?

1. The problem I’m having:

I want to set app http1.1 in caddyfile, like this:

example.com:8445 { 
     # expect example.com http1.1, how to config
    respond "Hello, world!!"
}

Global options will effect all app, but i just want to set one.

{
    debug
    servers {
        protocols h1
    }
}

2. Error messages and/or full log output:

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

3. Caddy version:

4. How I installed and ran Caddy:

a. System environment:

b. Command:

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

c. Service/unit/compose file:

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

d. My complete Caddy config:

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

5. Links to relevant resources:

If you want servers global options to only apply to one server, you need to specify a listener address that matches those sites. See the docs, it explains how that works.

You didn’t share your full config so I can’t accurately recommend a solution because it will be affected by whatever else is in your config.

Please completely fill out the help topic template, as per the forum rules. We can’t help otherwise.

a.example.com:443 { # expect http1.1
    bind 10.1.1.1
   respond "Hello, world!!"
}
b.example.com:443 { # expect http2
   bind 10.1.1.1
   respond "Hello, world!!"
}

I want to a.example.com http1.1, and b.example.com http2. a.example.com and b.example.com bind the same IP.

See this article: Http3 Demo | 萌え豚's Blog

You can use tls > alpn to set the supported protocols in the TLS handshake.

Thanks a lot