<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div apple-content-edited="true"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I've got a situation where the port being served to the outside world and the proxy port may not be the same. &nbsp;e.g. firewall:9000 =&gt; nginx:8080 =&gt; realserver:8000</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I'm currently using the following line which seems to take care of everything but the port:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" face="Verdana"><span class="Apple-tab-span" style="white-space:pre">        </span>proxy_redirect &nbsp;<a href="http://realserver:8000">http://realserver:8000</a> <a href="https://$host:9000">https://$host:9000</a>;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" face="Verdana"><br class="webkit-block-placeholder"></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" face="Verdana">I'd like something like this:</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" face="Verdana"><span class="Apple-tab-span" style="white-space:pre">        </span>proxy_redirect &nbsp;<a href="http://realserver:8000">http://realserver:8000</a> <a href="https://$host:$port">https://$host:$port</a>;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" face="Verdana"><br class="webkit-block-placeholder"></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" face="Verdana">Where $host:$port turns into firewall:9000 for the above example. &nbsp;I've found variables for both the nginx port and the realserver port, but can't find anything for the port the client sent the request to.</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" face="Verdana"><br class="webkit-block-placeholder"></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" color="#0011E0" face="Verdana"><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Helvetica; "><span class="Apple-style-span" style="font-family: Verdana; "><font class="Apple-style-span" color="#000000">Thanks,</font></span><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Verdana" size="3" style="font: normal normal normal 12px/normal Verdana; "><font class="Apple-style-span" color="#000000">Casey</font></font></div></span></font></div></div></span></div></body></html>