Welcome! Log In Create A New Profile

Advanced

Nginx upstream return name instead of server ip

September 29, 2021 09:20AM
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?
Subject Author Posted

Nginx upstream return name instead of server ip

rjvbzeoibvpzie September 29, 2021 09:20AM

Re: Nginx upstream return name instead of server ip

Maxim Dounin September 29, 2021 09:30AM

Re: Nginx upstream return name instead of server ip

rjvbzeoibvpzie September 29, 2021 09:43AM

Re: Nginx upstream return name instead of server ip

Maxim Dounin September 29, 2021 10:02AM

Re: Nginx upstream return name instead of server ip

rjvbzeoibvpzie September 29, 2021 10:41AM

Re: Nginx upstream return name instead of server ip

Maxim Dounin September 29, 2021 01:22PM

Re: Nginx upstream return name instead of server ip

rjvbzeoibvpzie September 29, 2021 01:34PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 122
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready