Ich möchte das Token aus meinem Anfrage-Header-Feld Autorisierung.Caching Token von Auth_request
Authorization : Bearer abcdefghijklmnopqrstuvwxyz
Mein Ziel ist es, dass ich nicht jede Anfrage über die Validierung-Server zu validieren. Wenn das Autorisierungs-Token zwischengespeichert (und gültig) ist, sollte die Anforderung die API ohne Validierung aufrufen.
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 "";
}
Dies ist mein Setup, aber das funktioniert nicht.
Ich hoffe, Sie können mir helfen.
Grüße!