nginx で静的ヘッダーを auth_request に渡すためのガイダンスが必要です。
私の場所の構成は次のとおりです。
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;
}
そして、私のサブリクエストは以下のようになります:
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/;
}
CallType ヘッダーを auth_request に渡す必要があります。add_header、proxy_set_header を試しましたが、うまくいきませんでした。
CallType ヘッダーを期待している auth_request の背後で認証するための Rest Api があります。
内部プロセスであるため、APIヘッダーの一部として渡すことはできません。