I need some guidance to pass a static header to auth_request in nginx.
My locations config is as below:
location = /auth {
internal;
proxy_pass http://authserver.com:8009/auth;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Original-URI $request_uri;
}
And my subrequest looks like below:
location = /app/finance/ {
proxy_pass_request_headers on;
# Custom header to be added
proxy_set_header CallType "MAJOR";
auth_request /auth;
error_page 401 =401 /auth;
proxy_pass http://myaddservice.com:8080/finance/;
}
I need to pass CallType header to auth_request.I have tried with add_header, proxy_set_header but it didnt work.
I have a Rest Api to authenticate behind auth_request which is expecting the CallType header.
I cannot make it pass as a part of api header because its an internal process.