I can confirm I see the same thing. If you use set_real_ip_from, real_ip_header, etc then it wipes out the $server_port value. Is there any work around to this? Posted at Nginx Forum: https://forum.nginx.org/read.php?2,261668,272576#msg-272576