diff options
author | Emily Lange <git@indeednotjames.com> | 2023-01-06 21:42:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-06 15:42:07 -0500 |
commit | e450a7377b00f7f2a99042ba8e440fed69072028 (patch) | |
tree | 09712e565d7df78d5c121b64bb9f7c24658d112d | |
parent | d74f6fd96790fc8f5abf302d9b10b0d333273d0d (diff) |
reverseproxy: Don't enable auto-https when `--from` flag is http (#5269)
-rw-r--r-- | modules/caddyhttp/reverseproxy/command.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/caddyhttp/reverseproxy/command.go b/modules/caddyhttp/reverseproxy/command.go index 1b63086..ca62191 100644 --- a/modules/caddyhttp/reverseproxy/command.go +++ b/modules/caddyhttp/reverseproxy/command.go @@ -172,6 +172,10 @@ func cmdReverseProxy(fs caddycmd.Flags) (int, error) { Listen: []string{":" + fromAddr.Port}, } + if fromAddr.Scheme == "http" { + server.AutoHTTPS = &caddyhttp.AutoHTTPSConfig{Disabled: true} + } + httpApp := caddyhttp.App{ Servers: map[string]*caddyhttp.Server{"proxy": server}, } |