summaryrefslogtreecommitdiff
path: root/modules/caddyhttp
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2022-08-12 17:09:18 -0400
committerGitHub <noreply@github.com>2022-08-12 17:09:18 -0400
commite2a5e2293ab0b06e33445a1243f36cd5def1de42 (patch)
treeb1a4913316a7543f4207dc543d76f0b29ee33663 /modules/caddyhttp
parentf5dce84a7028d1b116db7fead27ff8b2506baf78 (diff)
reverseproxy: Add `unix+h2c` Caddyfile network shortcut (#4953)
Diffstat (limited to 'modules/caddyhttp')
-rw-r--r--modules/caddyhttp/reverseproxy/addresses.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/caddyhttp/reverseproxy/addresses.go b/modules/caddyhttp/reverseproxy/addresses.go
index c161ed8..4da47fb 100644
--- a/modules/caddyhttp/reverseproxy/addresses.go
+++ b/modules/caddyhttp/reverseproxy/addresses.go
@@ -96,6 +96,12 @@ func parseUpstreamDialAddress(upstreamAddr string) (string, string, error) {
}
}
+ // special case network to support both unix and h2c at the same time
+ if network == "unix+h2c" {
+ network = "unix"
+ scheme = "h2c"
+ }
+
// for simplest possible config, we only need to include
// the network portion if the user specified one
if network != "" {