我正在尝试使用入口控制器注释将 nginx x-auth-request-email
标头重写为请求字符串,如下所示:
nginx.ingress.kubernetes.io/configuration-snippet: |
set $args user=$http_x_auth_request_email&$args;
翻译成 nginx.conf 中的同一行。
但是,$http_x_auth_request_email
以某种方式解析为请求中的空字符串,而我确实观察到了 x-auth-request-email header
中的预期值。
将 $http_x_auth_request_email
更改为更标准的标头(例如 $http_host
)按预期工作。
有没有办法让这个工作?
这里是完整的配置:
https://gist.github.com/roman-kouzmenko/e6f93f3bf5ca74c018f917a2d3fbf947#file-nginx-conf-L1198