Skip to content

Support Envoy's forwarded_proto_config for PROXY Protocol destination port-based X-Forwarded-Proto #7392

@zezaeoh

Description

@zezaeoh

Summary:
Envoy recently added forwarded_proto_config to infer X-Forwarded-Proto from PROXY Protocol
destination port (envoyproxy/envoy#43031, merged via envoyproxy/envoy#43088).

This enables proper HTTP→HTTPS redirect when using AWS NLB TLS termination + PROXY Protocol v2.

Envoy Configuration (new feature in main, will be in next release):

http_connection_manager:
  forwarded_proto_config:
    https_destination_ports: [443, 8443]
    http_destination_ports: [80, 8080]

Requested Feature:
Expose this in ContourConfiguration, likely under envoy.listener alongside existing useProxyProtocol:

apiVersion: projectcontour.io/v1alpha1
kind: ContourConfiguration
spec:
  envoy:
    listener:
      useProxyProtocol: true
      forwardedProtoConfig:           # NEW
        httpsDestinationPorts: [443]
        httpDestinationPorts: [80]

Implementation Notes:

  • Current PROXY Protocol handling: internal/xdscache/v3/listener.goproxyProtocol()
  • New config goes in: internal/envoy/v3/listener.gohttpConnectionManagerBuilder
  • The forwarded_proto_config is set on HCM, not on the listener filter

Use Case:
AWS NLB terminates TLS (ACM certificates) → PROXY Protocol v2 → Contour/Envoy.
Without this, X-Forwarded-Proto is always http, causing redirect loops with HTTPProxy's
tls.secretName (secure-first policy).

References:

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions