
私はいくつかのアップストリームをヘッダーのセットに基づいて選択していますが、https://github.com/GUI/nginx-upstream-dynamic-servers変数$destination
がアップストリームではなく URL として解釈されていることがわかります。以下はスニペットです:
http {
upstream LegacyService {
server my.server.location.com:443 max_fails=0 resolve;
}
upstream NewService {
server myNew.server.location.com:443 weight=100 max_fails=0 resolve;
}
...
map $http_some_header $destination {
default LegacyService;
"~marker" NewService;
}
server {
listen localhost:8080;
# lots of the usual setup
location / {
proxy_pass https://$destination;
}
}
}
この構成では、宛先がアップストリームの名前ではなく URL として解釈されるため、多くのエラーが発生します。
2021/08/09 11:05:56 [error] 15326#0: *5761 no live upstreams while connecting to upstream, client: 10.1.1.5, RequestID: 6ef3b58fc95e07b083e6186df62ba15d, server: my.server.com, request: "POST / HTTP/1.1", upstream: "https://LegacyService/", host: "my.server.com"
なぜこのような変更が起こっているのか理解し、何かできることはないか確認したいと思います。エラー メッセージの読み間違いでしょうか?