Configure Ingress controller to forward custom http headers

霸气de小男生 提交于 2019-12-04 10:25:55

If I want my ingress controller pass a custom header to my backend service, I can use this annotation in my ingress rule

nginx.ingress.kubernetes.io/configuration-snippet: |
  more_set_headers "Request-Id: $req_id";
Arne Deruwe

I ended up using the following configuration snippet:

nginx.ingress.kubernetes.io/configuration-snippet: |
  proxy_set_header My-Custom-Header $http_my_custom_header;

nginx makes all custom http headers available as embedded variable via the $http_ prefix, see this

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!