Istioを使うとLBでセットしたx-forwarded-protoが上書きされる
Istioを利用すると、LBでセットしたx-forwarded-protpがhttpに上書きされてしまうようです。
解決策、というかworkaroundがIssue内にあり、それを適用して回避しました。 istioのingressgatewayに来たrequestのx-forwarded-protpをhttpsに差し替えるという対応です。
httpも受け付けていたりすると、この対応では不都合が発生する可能性もあるのでこれが使えるかはケースバイケースです。
apiVersion: networking.istio.io/v1alpha3 kind: EnvoyFilter metadata: name: my-app-filter spec: workloadLabels: istio: ingressgateway filters: - filterName: envoy.lua filterType: HTTP filterConfig: inlineCode: | function envoy_on_request(request_handle) request_handle:headers():replace("x-forwarded-proto", "https") end function envoy_on_response(response_handle) end