mirror of
https://github.com/caddyserver/caddy.git
synced 2025-03-09 23:49:02 -04:00
reverseproxy: Add unix+h2c
Caddyfile network shortcut (#4953)
This commit is contained in:
parent
f5dce84a70
commit
e2a5e2293a
@ -1,6 +1,8 @@
|
|||||||
:8884
|
:8884
|
||||||
|
|
||||||
reverse_proxy h2c://localhost:8080
|
reverse_proxy h2c://localhost:8080
|
||||||
|
|
||||||
|
reverse_proxy unix+h2c//run/app.sock
|
||||||
----------
|
----------
|
||||||
{
|
{
|
||||||
"apps": {
|
"apps": {
|
||||||
@ -27,6 +29,21 @@ reverse_proxy h2c://localhost:8080
|
|||||||
"dial": "localhost:8080"
|
"dial": "localhost:8080"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"handler": "reverse_proxy",
|
||||||
|
"transport": {
|
||||||
|
"protocol": "http",
|
||||||
|
"versions": [
|
||||||
|
"h2c",
|
||||||
|
"2"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"upstreams": [
|
||||||
|
{
|
||||||
|
"dial": "unix//run/app.sock"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -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
|
// for simplest possible config, we only need to include
|
||||||
// the network portion if the user specified one
|
// the network portion if the user specified one
|
||||||
if network != "" {
|
if network != "" {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user