Nginx upstream return name instead of server ip

rjvbzeoibvpzie nginx-forum at forum.nginx.org
Wed Sep 29 13:20:20 UTC 2021


Here is my config:

-----
upstream http_backend {
    server 127.0.0.1:81;
    server 10.1.1.2 backup;
}

server {
    ...

    location /http/ {
        proxy_pass http://http_backend;
        ...
    }
}
-----

As long as everything is working, $upstream_addr returns the IP
(127.0.0.1:81). But when any backend returns HTTP/502, $upstream_addr
returns the upstream name (http_backend) as the $upstream_addr.

Shouldn't this return the lastest server IP tried before failure?

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,292491,292491#msg-292491



More information about the nginx mailing list