
헤더 세트를 기반으로 선택하는 업스트림이 여러 개 있지만 추가한 후에 찾고 있습니다.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"
이러한 변경이 발생하는 이유를 이해하고 조치할 수 있는 조치가 있는지 확인하고 싶습니다. 제가 오류 메시지를 잘못 읽었나요?