Skip to content

Allow changing header matched on for virtual hosts #4690

@snowp

Description

@snowp

We'd like to be able to specify which header(s) should be consulted when determining what virtual host to route to. Currently this reads the Host header, which means that for clients that don't allow overriding the Host header on a per-call basis (e.g. gRPC) we end up having to maintain one client per Host header we want to use. Since we're not using TLS in this case the extra clients are unnecessary and just ends up complicating our Envoy client libraries.

I'd love to have a domain_header option on the vhost that specifies a list of headers that are consulted, using the first non-empty. This would let me put domain_header: [virtual-host, :authority], allowing me to use virtual-host to determine what virtual host to use while also being able to fall back to using Host for other clients (e.g curl).

Another option would be a alternative_domain_header that allows setting a single header that is consulted before the Host header. This would ensure Envoy is well behaved wrt to the Host header but also allow our use case of having a single client target multiple vhosts.

A third option would be to simply introduce a x-envoy-virtual-host header that accomplishes all of this without any additional configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature requests. Not bugs or questions.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions