Skip to content

"Host" header not upgraded to "authority" #7732

@doublex

Description

@doublex

We use Caddy to upgrade a http/1.1 connection to http/3
Until caddy 2.10.2 the Host header was passed over as authority header.
After upgrading to 2.11.2 the authority header is set to localhost.

Detail: dynamic_upstreams service returns an SRV lookup-pair: ("localhost.", udp_port), e.g.:

SRV( target='localhost.', port=udp_port, priority=1, weight=1 )

Config (simplified)

{
  "apps": {
    "http": {
      "https_port": 8080,
      "servers": {
        "*": {
          "listen": [":8080"],
          "protocols": ["h1","h2"],
          "routes": [
            {
              "handle": [
                {
                  "handler": "reverse_proxy",
                  "dynamic_upstreams": {
                    "source": "srv",
                    "name": "_tcp.upstream.name",
                    "resolver": {
                      "addresses": ["udp/127.0.0.1:8001"]
                    }
                  },
                  "transport": {
                    "protocol": "http",
                    "versions": ["3"]
                  },
                  "headers": {
                    "request": {
                      "set": {
                        "X-Forwarded-For": ["{http.request.header.X-Forwarded-For}"]
                      }
                    }
                  }
                }
              ]
            }
          ]
        }
      }
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentation 📚Improvements or additions to documentationquestion ❔Help is being requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions