在kubernetes nginx入口控制器中传递请求头和请求体

在kubernetes nginx入口控制器中传递请求头和请求体,nginx,kubernetes,kubernetes-ingress,nginx-ingress,Nginx,Kubernetes,Kubernetes Ingress,Nginx Ingress,我正在传入ingress yaml文件中的授权头 nginx.ingress.kubernetes.io/configuration-snippet: | proxy_set_header Authorization "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1Ni......" 但是得到了错误 2021/03/01 09:23:58[emerg]947#947:参数可能太长 /tmp/nginx-cfg44508174:

我正在传入ingress yaml文件中的授权头

  nginx.ingress.kubernetes.io/configuration-snippet: |
      proxy_set_header Authorization "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1Ni......"
但是得到了错误

2021/03/01 09:23:58[emerg]947#947:参数可能太长 /tmp/nginx-cfg44508174:586中缺少终止字符“”

我还想将请求负载传递给auth url
传递授权标头和请求正文的正确方法是什么?

您可以传递授权标头

annotations:
  nginx.ingress.kubernetes.io/configuration-snippet: |
    proxy_set_header Authorization $http_authorization;

我可以这样传递curl命令吗:curl-k-X POST”“-H”accept:/“-H”Authorization:Bearer-eyj0exaiijkv…”-H“内容类型:application/json”-d“{\”operationId\”:\”query\”,\“scope\”:“region\”}“这是通过入口控制器将授权标头和请求有效负载传递到后端的正确方法吗?您可以尝试一下。您也可以使用cehck示例:否不是传递标头和正文..获取500个内部服务器错误给我分钟时间检查我几次前做的相同操作。