summaryrefslogtreecommitdiff
path: root/modules/caddyhttp
diff options
context:
space:
mode:
authorEmily Lange <git@indeednotjames.com>2023-01-06 21:42:07 +0100
committerGitHub <noreply@github.com>2023-01-06 15:42:07 -0500
commite450a7377b00f7f2a99042ba8e440fed69072028 (patch)
tree09712e565d7df78d5c121b64bb9f7c24658d112d /modules/caddyhttp
parentd74f6fd96790fc8f5abf302d9b10b0d333273d0d (diff)
reverseproxy: Don't enable auto-https when `--from` flag is http (#5269)
Diffstat (limited to 'modules/caddyhttp')
-rw-r--r--modules/caddyhttp/reverseproxy/command.go4
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},
}