Welcome! Log In Create A New Profile

Advanced

Re: Nginx upstream return name instead of server ip

Maxim Dounin
September 29, 2021 09:30AM
Hello!

On Wed, Sep 29, 2021 at 09:20:20AM -0400, rjvbzeoibvpzie wrote:

> 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?

The upstream name can be seen in $upstream_addr as long as nginx
is not able to select an upstream server because all servers are
not available per max_fails/fail_timeout. The "no live upstreams"
error is logged at the same time.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
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: 77
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready