mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-23 06:09:10 +08:00
reverseproxy: caddyfile: Don't add port if upstream has placeholder (#3819)
* check if the host is a placeholder * Update modules/caddyhttp/reverseproxy/caddyfile.go Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
This commit is contained in:
parent
db4f1c0277
commit
c9fdff9976
|
@ -155,7 +155,9 @@ func (h *Handler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
|
|||
if err != nil {
|
||||
host = upstreamAddr
|
||||
}
|
||||
if port == "" {
|
||||
// we can assume a port if only a hostname is specified, but use of a
|
||||
// placeholder without a port likely means a port will be filled in
|
||||
if port == "" && !strings.Contains(host, "{") {
|
||||
port = "80"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user