To illustrate what I mean look at this tomcat example:
<!-- This connector is for normal HTTP connections -->
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="30000" disableUploadTimeout="true" proxyPort="443"
proxyName="app.mydom.nl"
It is listening on 8080 but proceeded by a nginx proxy on 443 (in on 443, proxypass to 8080), anything tomcat replies to is send to the client with references to port 443 and not 8080 (as 8080 is not open externally).
<!-- This connector is for normal HTTP connections -->
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="30000" disableUploadTimeout="true" proxyPort="443"
proxyName="app.mydom.nl"
It is listening on 8080 but proceeded by a nginx proxy on 443 (in on 443, proxypass to 8080), anything tomcat replies to is send to the client with references to port 443 and not 8080 (as 8080 is not open externally).