Already tried $upstream_addr which unfortunately gives IP:port instead of hostname:port. My upstream needs hostname listed in conf instead of IP Posted at Nginx Forum: http://forum.nginx.org/read.php?2,257252,257258#msg-257258