How to set a protocol for a given handle/path in the same domain

1. The problem I’m having:

I am not able to setup a specific protocol for a path in a domain while using reverse proxy. Can someone please help me with this? Thanks.

2. Error messages and/or full log output:

3. Caddy version:

v2.6.4

4. How I installed and ran Caddy:

a. System environment:

b. Command:

c. Service/unit/compose file:

d. My complete Caddy config:

my-domain {
        respond "Protocol is {http.request.proto}"
        encode gzip
        reverse_proxy localhost:3000
        log {
                output file /var/log/caddy/one.log
        }
        handle /socket/* {
                reverse_proxy localhost:8081
        }
}

my-domain/socket/* {
        respond "Protocol is {http.request.proto}"
        encode gzip
        reverse_proxy localhost:8081
		tls {
                alpn http/1.1
        }
}.

5. Links to relevant resources:

What’s your goal here? What exactly are you trying to solve?

Please completely fill out the help topic template, as per the forum rules. We’re missing a lot of context here.

It’s not possible to change TLS options based on request path, because the TLS handshake happens before the HTTP body is even sent to the server.

Path matchers in the site address is deprecated.

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