Pass request header and request body in kubernetes nginx ingress controller

Viewed 1532

I am passing the authorization header in ingress yaml file

  nginx.ingress.kubernetes.io/configuration-snippet: |
      proxy_set_header Authorization "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1Ni......"

but getting the error

2021/03/01 09:23:58 [emerg] 947#947: too long parameter, probably missing terminating """ character in /tmp/nginx-cfg445808174:586

I want to pass the request payload as well to the auth-url what is the right way to pass the authorization header and request body?

1 Answers

you can pass the authorization header

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