リクエストヘッダーフィールドからトークンをキャッシュする必要があります。auth_requestからトークンをキャッシュする
Authorization : Bearer abcdefghijklmnopqrstuvwxyz
私の目標は、私は、検証、サーバー上のすべてのリクエストを検証する必要がないこと、です。承認トークンがキャッシュされている(有効である)場合、要求は検証なしでAPIを呼び出す必要があります。
location /main {
auth_request /auth;
proxy_ignore_headers Cache-Control;
proxy_pass http://API;
proxy_http_version 1.1;
}
location /auth {
internal;
proxy_cache my_cache;
proxy_ignore_headers Cache-Control;
proxy_cache_key "$http_authorization";
proxy_pass https://validationserver;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
}
これは私の設定ですが、これは機能しません。
私があなたを助けてくれることを願っています。
おはようございます!