Can I access the original client source port of requests to OpenShift Routes?

Solution Unverified - Updated -

Issue

The OpenShift Router (HAProxy IngressController) acts as a reverse-proxy for requests send to the OpenShift Routes. This results with the original IP addresses and ports masked as the connection is forwarded to the backend Pods.

The official OpenShift Documentation - Using X-Forwarded headers indicates that the IP address and destination port can be stored in X-Forwarded-* HTTP headers. These headers can be read by the HTTP application to gather the client IP address and destination port.

Is there a way to collect the original clients source-port with an X-Forwarded-* value such as X-Forwarded-SourcePort?

Environment

  • OpenShift Container Platform
    • 4.8+

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content