以下の内容はhttps://kamihikouki.hatenablog.com/entry/2019/05/15/190209より取得しました。


Istioを使うとLBでセットしたx-forwarded-protoが上書きされる

Istioを利用すると、LBでセットしたx-forwarded-protpがhttpに上書きされてしまうようです。

Istio give `x-forwarded-proto=http` to upstream server when using SSL termination · Issue #7964 · istio/istio · GitHub

解決策、というか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



以上の内容はhttps://kamihikouki.hatenablog.com/entry/2019/05/15/190209より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14