Forum: NGINX $upstream_addr is returning blank

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2974d09ac2541e892966b762aad84943?d=identicon&s=25 tsunny (Guest)
on 2014-06-19 09:01
(Received via mailing list)
Hello,

I want to access the value of $upstream_addr. Below is the code,

location / {

    echo "up = $upstream_addr";

}


The response is just "up = " . What could be the reason for this?

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,251039,251039#msg-251039
40b4c848b8fcd63b0cb60b9d170c3a77?d=identicon&s=25 Valentin V. Bartenev (Guest)
on 2014-06-19 09:33
(Received via mailing list)
On Thursday 19 June 2014 03:00:44 tsunny wrote:
>
> The response is just "up = " . What could be the reason for this?
>

The $upstream_addr variable keeps the addresses of the servers that were
contacted during request processing.  So, if there aren't any at the
moment of evaluation of the variable, then it will be empty.

  wbr, Valentin V. Bartenev
2974d09ac2541e892966b762aad84943?d=identicon&s=25 tsunny (Guest)
on 2014-06-19 14:24
(Received via mailing list)
Thanks Valentin V. Bartenev !!

I was using it before the line

proxy_pass http://xyz.com

After placing the code after proxy_pass, I am able to see the values..

Regards,
Sunny

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,251039,251049#msg-251049
This topic is locked and can not be replied to.