mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-27 06:03:48 +03: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
1 changed files with 3 additions and 1 deletions
|
@ -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 a new issue