当我在 Nignx.conf 中对 Authorization 标头进行硬编码时,它工作正常,但是当尝试使用传递参数动态传递它时,它不起作用。 硬编码部分(工作正常):
location ^~ / {
#Authorization is hard coded which is working fine.
set $key1 ZENvUXozb0JGUWU4NTlITERVZzI6ZG8yaklicWNTbi1YMXNIVnlQNE5Hdw;
proxy_set_header Authorization "ApiKey $key1";
# Forward requests to Kibana
proxy_pass https://timized-deployment-e.kb.us-east-1.aws.found.io:9246;
使用 URL 参数动态传递(不起作用):
location ^~ / {
#Authorization is ha
set $key1 $args;
proxy_set_header Authorization "ApiKey $key1";
# Forward requests to Kibana
proxy_pass https://i-o-optimized-deployment-e684e2.kb.us-east-1.aws.found.io:9243;