0

So here is my setup

https -> AWB ALB -> ingress-nginx -> sonarqube

The x-forwarded-proto header received at the ingress and subsequently sonarqube is http because ssl offloads at the ALB. I want to change x-forwarded-proto to https. So far I have tried

  • proxy_set_header X-Forwarded-Proto https; which results in the header being appended as "x-forwarded-proto": "http, https" which is not what I require.
  • more_clear_input_headers "x-forwarded-proto" in an attempt to clear the header which does not work for this and many other (works for user-agent though)
  • more_set_input_headers "X-Forwarded-Proto: https" which does not update the header value for this and many other headers but works for adding some custom headers.

I am using the kubernetes ingress-nginx

Why is it that I am unable to clear or set some headers but not all, especially the X-Forwarded-*

Faheem Sohail
  • 806
  • 8
  • 21

1 Answers1

-1

The X-Forwarded-Proto request header helps you identify the protocol (HTTP or HTTPS) that a client used to connect to your load balancer. Your server access logs contain only the protocol used between the server and the load balancer; they contain no information about the protocol used between the client and the load balancer. To determine the protocol used between the client and the load balancer, use the X-Forwarded-Proto request header. Elastic Load Balancing stores the protocol used between the client and the load balancer in the X-Forwarded-Proto request header and passes the header along to your server.

Your application or website can use the protocol stored in the X-Forwarded-Proto request header to render a response that redirects to the appropriate URL.

The X-Forwarded-Proto request header takes the following form:

X-Forwarded-Proto: originatingProtocol

The following example contains an X-Forwarded-Proto request header for a request that originated from the client as an HTTPS request: X-Forwarded-Proto: https

For more information please refer to this document.