reverseproxy: Don't enable auto-https when --from flag is http (#5269)

This commit is contained in:
Emily Lange 2023-01-06 21:42:07 +01:00 committed by GitHub
parent d74f6fd967
commit e450a7377b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -172,6 +172,10 @@ func cmdReverseProxy(fs caddycmd.Flags) (int, error) {
Listen: []string{":" + fromAddr.Port}, Listen: []string{":" + fromAddr.Port},
} }
if fromAddr.Scheme == "http" {
server.AutoHTTPS = &caddyhttp.AutoHTTPSConfig{Disabled: true}
}
httpApp := caddyhttp.App{ httpApp := caddyhttp.App{
Servers: map[string]*caddyhttp.Server{"proxy": server}, Servers: map[string]*caddyhttp.Server{"proxy": server},
} }